Bandidos
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
com.mygdx.game.entities.ButtonEntity Class Reference
Inheritance diagram for com.mygdx.game.entities.ButtonEntity:
com.mygdx.game.engine.entities.BaseEntity com.mygdx.game.engine.events.IEventReceiver com.mygdx.game.engine.events.EventDispatcher

Public Member Functions

 ButtonEntity (String buttonAtlas)
 
void setButtonTouchLayer (int layer)
 
int getButtonTouchLayer ()
 
void onButtonDown ()
 
void onButtonUp ()
 
RenderComponent getRenderComponent ()
 
boolean isButtonPressed ()
 
void onReceiveEvent (Event event)
 
- Public Member Functions inherited from com.mygdx.game.engine.entities.BaseEntity
 BaseEntity ()
 
TransformComponent getTransformComponent ()
 
boolean hasInstanceOfComponent (BaseEntityComponent componentInstance)
 
void addTag (String tag)
 
void removeTag (String tag)
 
boolean hasTag (String tag)
 
void update (float dt)
 
void render (RenderComponents renderComponents)
 
void destroy ()
 
boolean isDestroyed ()
 
- Public Member Functions inherited from com.mygdx.game.engine.events.EventDispatcher
void addEventListener (String type, IEventReceiver listeningClass)
 
void dispatchEvent (Event event)
 
void removeEventListener (String type, IEventReceiver listener)
 
boolean hasEventListener (String type)
 
ArrayList< ListenerItemgetAllListeners ()
 
void destroyAllListeners ()
 
void clean ()
 

Static Public Attributes

static final int ANY_TOUCH_LAYER = -1337
 

Protected Member Functions

void awake ()
 
void updated (float dt)
 
void rendered (RenderComponents renderComponents)
 
void destroyed ()
 
- Protected Member Functions inherited from com.mygdx.game.engine.entities.BaseEntity
abstract void awake ()
 
abstract void updated (float dt)
 
abstract void rendered (RenderComponents renderComponents)
 
abstract void destroyed ()
 

Detailed Description

An entity for a Button. This can be used for whenever a button is needed. For example a play button for on the main menu, or a pause button.

Author
Djamali

Constructor & Destructor Documentation

◆ ButtonEntity()

com.mygdx.game.entities.ButtonEntity.ButtonEntity ( String  buttonAtlas)

Member Function Documentation

◆ awake()

void com.mygdx.game.entities.ButtonEntity.awake ( )
protected

◆ destroyed()

void com.mygdx.game.entities.ButtonEntity.destroyed ( )
protected

◆ getButtonTouchLayer()

int com.mygdx.game.entities.ButtonEntity.getButtonTouchLayer ( )

Gets the touch layer in which the button can be interacted with.

Returns
layer of the button (DEFAULT: ButtonEntity.ANY_TOUCH_LAYER (-1337))

◆ getRenderComponent()

RenderComponent com.mygdx.game.entities.ButtonEntity.getRenderComponent ( )

Returns the RenderComponent for the TextEntity WARNING: Do not remove the RenderComponent

Returns
The RenderComponent attached to the TextEntity

◆ isButtonPressed()

boolean com.mygdx.game.entities.ButtonEntity.isButtonPressed ( )
Returns
_isButtonPressed

◆ onButtonDown()

void com.mygdx.game.entities.ButtonEntity.onButtonDown ( )

Sets the button state to down and dispatches the event for it.

◆ onButtonUp()

void com.mygdx.game.entities.ButtonEntity.onButtonUp ( )

Sets the button state to up and dispatches the event for it.

◆ onReceiveEvent()

void com.mygdx.game.entities.ButtonEntity.onReceiveEvent ( Event  event)

This will be triggered when an event has been fired of type which this implementing class was listening to.

Parameters
eventwhich has one of the event types which is listened to.

Implements com.mygdx.game.engine.events.IEventReceiver.

◆ rendered()

void com.mygdx.game.entities.ButtonEntity.rendered ( RenderComponents  renderComponents)
protected

◆ setButtonTouchLayer()

void com.mygdx.game.entities.ButtonEntity.setButtonTouchLayer ( int  layer)

Sets the touch layer in which the button can be interacted with.

Parameters
layerof the button (DEFAULT: ButtonEntity.ANY_TOUCH_LAYER (-1337))

◆ updated()

void com.mygdx.game.entities.ButtonEntity.updated ( float  dt)
protected

Member Data Documentation

◆ ANY_TOUCH_LAYER

final int com.mygdx.game.entities.ButtonEntity.ANY_TOUCH_LAYER = -1337
static

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