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

Public Member Functions

 TextEntity (boolean isUI)
 
 TextEntity (String text, boolean isUI)
 
 TextEntity (FontData fontData, boolean isUI)
 
 TextEntity (FontData fontData, String text, boolean isUI)
 
void setFont (FontData fontData)
 
void setText (String text)
 
void setFontSize (float size)
 
RenderComponent getRenderComponent ()
 
Vector2 getTextBounds ()
 
- 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 ()
 

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

This class is an entity which renders Text on the screen.

Author
Ramses Di Perna

Constructor & Destructor Documentation

◆ TextEntity() [1/4]

com.mygdx.game.engine.entities.TextEntity.TextEntity ( boolean  isUI)

Creates an empty text with the default font.

Parameters
isUIindicates if this entity should be rendered on the HudCam. If true it will be rendered on the HudCam else on the MainCam

◆ TextEntity() [2/4]

com.mygdx.game.engine.entities.TextEntity.TextEntity ( String  text,
boolean  isUI 
)

Creates a text entity with the given text and default font

Parameters
textto give the text
isUIindicates if this entity should be rendered on the HudCam. If true it will be rendered on the HudCam else on the MainCam

◆ TextEntity() [3/4]

com.mygdx.game.engine.entities.TextEntity.TextEntity ( FontData  fontData,
boolean  isUI 
)

Creates an empty text with the given font.

Parameters
fontDataof the font to give this textEntity
isUIindicates if this entity should be rendered on the HudCam. If true it will be rendered on the HudCam else on the MainCam

◆ TextEntity() [4/4]

com.mygdx.game.engine.entities.TextEntity.TextEntity ( FontData  fontData,
String  text,
boolean  isUI 
)

Creates a text entity with the given text and the given font

Parameters
fontDataof the font to give this textEntity
textto give the text
isUIindicates if this entity should be rendered on the HudCam. If true it will be rendered on the HudCam else on the MainCam

Member Function Documentation

◆ awake()

void com.mygdx.game.engine.entities.TextEntity.awake ( )
protected

◆ destroyed()

void com.mygdx.game.engine.entities.TextEntity.destroyed ( )
protected

◆ getRenderComponent()

RenderComponent com.mygdx.game.engine.entities.TextEntity.getRenderComponent ( )

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

Returns
The RenderComponent attached to the TextEntity

◆ getTextBounds()

Vector2 com.mygdx.game.engine.entities.TextEntity.getTextBounds ( )

◆ rendered()

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

◆ setFont()

void com.mygdx.game.engine.entities.TextEntity.setFont ( FontData  fontData)

Sets the font for this TextEntity

Parameters
fontDataof the font to give this textEntity

◆ setFontSize()

void com.mygdx.game.engine.entities.TextEntity.setFontSize ( float  size)

Sets the fontsize for this TextEntity. (Default: 12)

Parameters
sizefor font to display as.

◆ setText()

void com.mygdx.game.engine.entities.TextEntity.setText ( String  text)

Sets the text for this TextEntity

Parameters
textto display

◆ updated()

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

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