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

Public Member Functions

 Shape ()
 
void setSize (float new_size)
 
float getSize () const
 
void setType (ShapeType new_type)
 
ShapeType getType () const
 
void setColor (Color new_color)
 
void setColor (unsigned char r, unsigned char g, unsigned char b)
 
Color getColor () const
 
void setOpacity (unsigned char new_opacity)
 
unsigned char getOpacity () const
 
void draw (Vector world_pos)
 

Private Attributes

Color m_color
 
unsigned char m_r
 
unsigned char m_g
 
unsigned char m_b
 
ShapeType m_type
 
float m_size
 
unsigned char m_opacity
 

Constructor & Destructor Documentation

df::Shape::Shape ( )

Default is Circle, df::WHITE, size 1 character.

Member Function Documentation

void df::Shape::draw ( Vector  world_pos)

Draw self at given world position.

Color df::Shape::getColor ( ) const

Get color. Returns Dragonfly Color.

unsigned char df::Shape::getOpacity ( ) const

Get opacity (0 is transparent, 255 is opaque).

float df::Shape::getSize ( ) const

Get size (in pixels).

ShapeType df::Shape::getType ( ) const

Get type.

void df::Shape::setColor ( Color  new_color)

Set color, where input is Dragonfly Color.

void df::Shape::setColor ( unsigned char  r,
unsigned char  g,
unsigned char  b 
)

Set color, where input is RGB.

void df::Shape::setOpacity ( unsigned char  new_opacity)

Set opacity (0 is transparent, 255 is opaque).

void df::Shape::setSize ( float  new_size)

Set size (in pixels).

void df::Shape::setType ( ShapeType  new_type)

Set type.

Member Data Documentation

unsigned char df::Shape::m_b
private

RGB colors used if color is CUSTOM.

Color df::Shape::m_color
private

Shape color.

unsigned char df::Shape::m_opacity
private

Opacity (transparent) 0 to 255 (opaque).

float df::Shape::m_size
private

Radius size (in pixels).

ShapeType df::Shape::m_type
private

Type of shape.