Dragonfly 4.20
A text-based game engine
|
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) |
int | serialize (std::stringstream *p_ss) const |
int | deserialize (std::stringstream *p_ss) |
bool | operator== (const Shape &s) |
bool | operator!= (const Shape &s) |
std::string | toString () const |
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 |
df::Shape::Shape | ( | ) |
Default is Circle, df::WHITE, size 1 character.
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.
bool df::Shape::operator== | ( | const Shape & | s | ) |
Compare two Shapes.
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.
|
private |
RGB colors used if color is CUSTOM.
|
private |
Opacity (transparent) 0 to 255 (opaque).
|
private |
Radius size (in pixels).
|
private |
Type of shape.