Dragonfly 4.19
A text-based game engine
|
Public Member Functions | |
int | eventHandler (const Event *p_e) override |
void | setHighlightColor (Color new_highlight_color) |
Color | getHighlightColor () const |
void | setDefaultColor (Color new_default_color) |
Color | getDefaultColor () const |
bool | mouseOverButton (const EventMouse *p_e) const |
virtual void | callback ()=0 |
virtual std::string | serialize (std::string attr="") override |
virtual int | deserialize (std::string s) override |
virtual bool | isModified (enum ButtonAttribute attribute) const |
virtual bool | isModified () const override |
Public Member Functions inherited from df::ViewObject | |
ViewObject () | |
virtual int | draw () override |
virtual int | eventHandler (const Event *p_e) override |
void | setLocation (ViewObjectLocation new_location) |
ViewObjectLocation | getLocation () const |
void | setDrawValue (bool new_draw_value=true) |
bool | getDrawValue () const |
void | setValue (int new_value) |
int | getValue () const |
void | setBorder (bool new_border) |
bool | getBorder () const |
void | setColor (Color new_color) |
Color | getColor () const |
void | setViewString (std::string new_view_string) |
std::string | getViewString () const |
virtual int | setPosition (Vector new_pos) override |
virtual std::string | serialize (std::string attr="") override |
virtual int | deserialize (std::string s) override |
virtual bool | isModified (enum ViewObjectAttribute attribute) const |
virtual bool | isModified () const override |
Public Member Functions inherited from df::Object | |
Object () | |
virtual | ~Object () |
void | setId (int new_id) |
int | getId () const |
void | setType (std::string new_type) |
std::string | getType () const |
virtual int | setPosition (Vector new_position) |
Vector | getPosition () const |
virtual int | eventHandler (const Event *p_event) |
bool | isSolid () const |
int | setSolidness (Solidness new_solid) |
Solidness | getSolidness () const |
void | setNoSoft (bool new_no_soft=true) |
bool | getNoSoft () const |
void | setAvoidCollisions (bool new_avoid_collisions=true) |
bool | getAvoidCollisions () const |
int | setAltitude (int new_altitude) |
int | getAltitude () const |
void | setSpeed (float speed) |
float | getSpeed () const |
void | setDirection (Vector new_direction) |
Vector | getDirection () const |
void | setVelocity (Vector velocity) |
Vector | getVelocity () const |
void | setAcceleration (Vector new_acceleration) |
Vector | getAcceleration () const |
void | accelerate () |
Vector | predictPosition () |
void | pathTo (Vector position) |
void | pathTo (Object *p_o_target) |
void | moveTo (Vector new_position) |
void | doPathFollowing () |
int | setVisible (bool new_visible=true) |
bool | isVisible () const |
int | setActive (bool new_active=true) |
bool | isActive () const |
void | setBox (Box new_box) |
Box | getBox () const |
int | registerInterest (std::string event_type) |
int | unregisterInterest (std::string event_type) |
int | setSprite (std::string sprite_label) |
void | setAnimation (Animation new_animation, bool set_box=true) |
Animation | getAnimation () const |
virtual int | draw () |
virtual std::string | serialize (std::string attr="") |
virtual int | deserialize (std::string s) |
virtual bool | isModified (enum ObjectAttribute attribute) const |
virtual bool | isModified () const |
void | setShape (Shape new_shape) |
Shape | getShape () const |
void | setFollowPath (bool new_follow_path=true) |
bool | getFollowPath () const |
void | setPath (Path new_path) |
Path | getPath () const |
PathFind * | getPathFind () |
std::string | toString () const |
Private Attributes | |
Color | m_highlight_color |
Color | m_default_color |
bool | m_bmodified [BATTR_COUNT] |
Additional Inherited Members | |
Static Public Attributes inherited from df::Object | |
static int | max_id |
|
pure virtual |
Called when Button clicked.
Must be defined by derived class.
|
overridevirtual |
Deserialize string to become attributes.
Rerturn 0 if no errors, else -1.
Reimplemented from df::ViewObject.
|
overridevirtual |
|
overridevirtual |
Return true if any attribute modified since last serialize.
Reimplemented from df::ViewObject.
|
virtual |
Return true if attribute modified since last serialize.
bool df::Button::mouseOverButton | ( | const EventMouse * | p_e | ) | const |
Return true if mouse over Button, else false.
|
overridevirtual |
Serialize Button attributes to single string.
Can specify attribute to serialize (default "" means all modified). If attr is "ALL", serialize all attributes (modified or not). Clear m_bmodified[] array for attributes serialized.
Reimplemented from df::ViewObject.
void df::Button::setHighlightColor | ( | Color | new_highlight_color | ) |
Set highlight (when mouse over) color for Button.
|
private |
Modified attribute since serialize().
|
private |
Color when not highlighted.
|
private |
Color when highlighted.