FYP  1.0.0
Final Year Project -- Alexander Meuer
gui::Button Class Reference

Clickable sprite. More...

#include <Button.hpp>

Inheritance diagram for gui::Button:
Inheritance graph
Collaboration diagram for gui::Button:
Collaboration graph

Public Member Functions

 Button (int x, int y, const tinyxml2::XMLElement *xmlButtonDefinition)
 
virtual void update (sf::Vector2i const &mousePos)
 
bool checkClick () const
 
void enable ()
 
void disable ()
 
bool containsMouse () const
 
std::string const & getName () const
 
void setPosition (sf::Vector2f const &position)
 
sf::Vector2f const & getPosition () const
 
sf::Vector2f const & getSize () const
 
sf::Vector2f const & getScale () const
 

Protected Types

enum  State { NORMAL, HOVER, DISABLED }
 

Protected Member Functions

void draw (sf::RenderTarget &target, sf::RenderStates states) const override
 
void setState (State newState)
 

Protected Attributes

enum gui::Button::State mState
 

Private Attributes

sf::RectangleShape mGraphic
 
sf::Sound mOnHoverSound
 
sf::IntRect mNormalSrcRect
 
sf::IntRect mHoverSrcRect
 
sf::IntRect mDisabledSrcRect
 
std::string mName
 
bool mMouseOver
 True if the mouse is within bounds.
 

Detailed Description

Clickable sprite.


The documentation for this class was generated from the following file: