Dragonfly 4.19
A text-based game engine
Public Member Functions | Private Attributes | List of all members
df::Frame Class Reference

Public Member Functions

 Frame ()
 
 Frame (int new_width, int new_height, std::string frame_str)
 
void setWidth (int new_width)
 
int getWidth () const
 
void setHeight (int new_height)
 
int getHeight () const
 
void setString (std::string new_frame_str)
 
std::string getString () const
 
int draw (Vector position, Color color, char transparency) const
 

Private Attributes

int m_width
 
int m_height
 
std::string m_frame_str
 

Constructor & Destructor Documentation

◆ Frame() [1/2]

df::Frame::Frame ( )

Create empty frame.

◆ Frame() [2/2]

df::Frame::Frame ( int  new_width,
int  new_height,
std::string  frame_str 
)

Create frame of indicated width and height with string.

Member Function Documentation

◆ draw()

int df::Frame::draw ( Vector  position,
Color  color,
char  transparency 
) const

Draw self, centered at position (x,y) with color.

Don't draw transparent characters (0 means none). Return 0 if ok, else -1. Note: top-left coordinate is (0,0).

◆ getHeight()

int df::Frame::getHeight ( ) const

Get height of frame.

◆ getString()

std::string df::Frame::getString ( ) const

Get frame characters (stored as string).

◆ getWidth()

int df::Frame::getWidth ( ) const

Get width of frame.

◆ setHeight()

void df::Frame::setHeight ( int  new_height)

Set height of frame.

◆ setString()

void df::Frame::setString ( std::string  new_frame_str)

Set frame characters (stored as string).

◆ setWidth()

void df::Frame::setWidth ( int  new_width)

Set width of frame.

Member Data Documentation

◆ m_frame_str

std::string df::Frame::m_frame_str
private

All frame characters stored as string.

◆ m_height

int df::Frame::m_height
private

Height of frame.

◆ m_width

int df::Frame::m_width
private

Width of frame.