StarEngine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Protected Member Functions | List of all members
star::Button Class Referencefinal

#include <Button.h>

Inheritance diagram for star::Button:
Inheritance graph
Collaboration diagram for star::Button:
Collaboration graph

Public Types

typedef std::function< void()> ButtonAction
 

Public Member Functions

 Button (const tstring &assetFile, const tstring &spriteName, bool isSpriteSheet=false, int Heightsegments=1, bool isHudElement=true)
 
 ~Button ()
 
void SetOnHoverCallback (ButtonAction onHover)
 
void SetOnClickCallback (ButtonAction onClick)
 
void SetOnLeaveCallback (ButtonAction onLeave)
 
- Public Member Functions inherited from star::Object
 Object ()
 
virtual ~Object (void)
 
ObjectGetParent () const
 
void BaseInitialize ()
 
void BaseUpdate (const Context &context)
 
void BaseDraw ()
 
const tstringGetName () const
 
void SetName (const tstring &name)
 
void AddComponent (BaseComponent *pComponent)
 
void RemoveComponent (const BaseComponent *pComponent)
 
void AddChild (Object *pObject)
 
void RemoveChild (const Object *pObject)
 
std::vector< Object * > & GetChildren ()
 
void SetCollisionTag (const tstring &tag)
 
const tstringGetCollisionTag () const
 
void SetVisible (bool visible)
 
bool IsVisible () const
 
void Freeze (bool freeze)
 
bool IsFrozen () const
 
void SetDisabled (bool disabled)
 
bool IsDisabled () const
 
void CollisionCheck (Object *otherObject)
 
bool RectangleCollision (Object *object, Object *otherObject)
 
bool CircleCollision (Object *object, Object *otherObject)
 
bool RectangleCircleCollision (Object *object, Object *otherObject)
 
void SetScene (BaseScene *pScene)
 
void UnsetScene ()
 
TransformComponentGetTransform () const
 
BaseSceneGetScene () const
 
template<class T >
T * GetComponent (bool searchChildren=false) const
 
template<class T >
T * GetChild () const
 
template<class T >
T * GetChild (const tstring &name) const
 

Protected Member Functions

void Initialize ()
 
void Update (const Context &context)
 
void Draw (const Context &context)
 
void OnClick ()
 
void OnHover ()
 
void OnLeave ()
 
- Protected Member Functions inherited from star::Object
virtual void Draw ()
 

Additional Inherited Members

- Protected Attributes inherited from star::Object
bool m_bIsInitialized
 
bool m_IsVisible
 
bool m_IsFrozen
 
Objectm_pParentGameObject
 
PathFindNodeComponentm_pPathFindComp
 
BaseScenem_pScene
 
std::vector< BaseComponent * > m_pComponents
 
std::vector< Object * > m_pChildren
 
tstring m_Name
 
tstring m_CollisionTag
 

Member Typedef Documentation

typedef std::function<void()> star::Button::ButtonAction

Constructor & Destructor Documentation

star::Button::Button ( const tstring assetFile,
const tstring spriteName,
bool  isSpriteSheet = false,
int  Heightsegments = 1,
bool  isHudElement = true 
)
star::Button::~Button ( void  )

Member Function Documentation

void star::Button::Draw ( const Context context)
protected
void star::Button::Initialize ( void  )
protectedvirtual

Reimplemented from star::Object.

void star::Button::OnClick ( )
protected
void star::Button::OnHover ( )
protected
void star::Button::OnLeave ( )
protected
void star::Button::SetOnClickCallback ( ButtonAction  onClick)
void star::Button::SetOnHoverCallback ( ButtonAction  onHover)
void star::Button::SetOnLeaveCallback ( ButtonAction  onLeave)
void star::Button::Update ( const Context context)
protectedvirtual

Reimplemented from star::Object.


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