Bandidos
Public Member Functions | Protected Member Functions | List of all members
com.mygdx.game.engine.entities.components.rendering.RenderComponent Class Reference
Inheritance diagram for com.mygdx.game.engine.entities.components.rendering.RenderComponent:
com.mygdx.game.engine.entities.components.BaseEntityComponent com.mygdx.game.engine.events.EventDispatcher com.mygdx.game.engine.entities.components.rendering.AnimationComponent

Public Member Functions

 RenderComponent (RenderInfo startRenderInfo, boolean isUI)
 
boolean isUserInterface ()
 
boolean isSortedOnY ()
 
int getCurrentFrameInfo ()
 
void setCurrentFrameInfo (int index)
 
void setSortOnY (boolean sortOnY)
 
double getInnerSortingLayer ()
 
int getSortingLayer ()
 
void setSortingLayer (int sortingLayer)
 
float getRealWidth ()
 
float getRealHeight ()
 
float getPivotX ()
 
float getPivotY ()
 
void setPivot (float pivotX, float pivotY, boolean keepPosition)
 
RenderInfo getRenderInfo ()
 
boolean getCallsRenderAfterEntityRender ()
 
void setCallsRenderAfterEntityRender (boolean renderAfterEntityRender)
 
void setAlpha (float alpha)
 
float getAlpha ()
 
EngineTween doAlpha (float value, float duration, TweenStartType tweenStartType)
 
EngineTween doColor (Color color, float duration, TweenStartType tweenStartType)
 
void setColor (Color color)
 
void setColor (float r, float g, float b, float a)
 
Color getColor ()
 
void setRenderInfo (RenderInfo info)
 
Texture getCurrentTexture ()
 
void setCurrentTexture (Texture texture)
 
boolean getFlipX ()
 
boolean getFlipY ()
 
void setFlipX (boolean flipX)
 
void setFlipY (boolean flipY)
 
int compare (RenderComponent d, RenderComponent d1)
 
int compareTo (RenderComponent comp)
 
void awake ()
 
- Public Member Functions inherited from com.mygdx.game.engine.entities.components.BaseEntityComponent
EngineTween startTweenOnComponent (Tween tween, TweenStartType tweenStartType)
 
Timeline startTimelineOnComponent (Timeline timeline, boolean updateInGameTime)
 
EngineTween doFloat (TweenableFloat floatToTween, float newValue, float duration, TweenStartType tweenStartType)
 
void stopAllComponentTweens ()
 
void initialize (BaseEntity parentEntity)
 
BaseEntity getParentOfComponent ()
 
boolean isActive ()
 
boolean isDestroyed ()
 
void setActiveState (boolean activeState)
 
void destroy ()
 
void update (float deltaTime)
 
abstract void awake ()
 
- 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 updated (float deltaTime)
 
void destroyed ()
 
void activeStateChanged ()
 
- Protected Member Functions inherited from com.mygdx.game.engine.entities.components.BaseEntityComponent
abstract void updated (float deltaTime)
 
abstract void destroyed ()
 
abstract void activeStateChanged ()
 

Detailed Description

This component contains the 2D render information of the entity it is attached to. (Texture to render, pivot point, height and width)

Author
Ramses Di Perna

Constructor & Destructor Documentation

◆ RenderComponent()

com.mygdx.game.engine.entities.components.rendering.RenderComponent.RenderComponent ( RenderInfo  startRenderInfo,
boolean  isUI 
)

Member Function Documentation

◆ activeStateChanged()

void com.mygdx.game.engine.entities.components.rendering.RenderComponent.activeStateChanged ( )
protected

◆ awake()

void com.mygdx.game.engine.entities.components.rendering.RenderComponent.awake ( )

◆ compare()

int com.mygdx.game.engine.entities.components.rendering.RenderComponent.compare ( RenderComponent  d,
RenderComponent  d1 
)

◆ compareTo()

int com.mygdx.game.engine.entities.components.rendering.RenderComponent.compareTo ( RenderComponent  comp)

◆ destroyed()

void com.mygdx.game.engine.entities.components.rendering.RenderComponent.destroyed ( )
protected

◆ doAlpha()

EngineTween com.mygdx.game.engine.entities.components.rendering.RenderComponent.doAlpha ( float  value,
float  duration,
TweenStartType  tweenStartType 
)

Tweens the entity to the given alpha in the given duration. The Tween can still be modified by the return value The Tween will be updated in the Component channel. (EngineTweener)

Parameters
valueindicates the alpha to tween to. 1 is fully visible and 0 is not visible
durationin seconds on how long to take until reaching the alpha value
gameTimemeans, when set to true, this tween will be effected by the Time Scale of the game, else it will not (False recommended for UI elements) Tween which will be executed.

◆ doColor()

EngineTween com.mygdx.game.engine.entities.components.rendering.RenderComponent.doColor ( Color  color,
float  duration,
TweenStartType  tweenStartType 
)

Tweens the entity to the given color in the given duration. The Tween can still be modified by the return value The Tween will be updated in the Component channel. (EngineTweener)

Parameters
colorindicates the color to tween to.
durationin seconds on how long to take until reaching the color value
gameTimemeans, when set to true, this tween will be effected by the Time Scale of the game, else it will not (False recommended for UI elements) Tween which will be executed.

◆ getAlpha()

float com.mygdx.game.engine.entities.components.rendering.RenderComponent.getAlpha ( )

This gets the alpha of the Color which is modifying the current entity.

Returns
alpha of the current modifying color.

◆ getCallsRenderAfterEntityRender()

boolean com.mygdx.game.engine.entities.components.rendering.RenderComponent.getCallsRenderAfterEntityRender ( )

Returns If true, that means the 'Rendered' method in the Entity is called after this component is rendered. Else, if false, it will be called before

Returns
True if rendered is called after, else false

◆ getColor()

Color com.mygdx.game.engine.entities.components.rendering.RenderComponent.getColor ( )

This gets the color which is modifying the current entity. The color White equals its original color

Returns
The color this entity has as modification color

◆ getCurrentFrameInfo()

int com.mygdx.game.engine.entities.components.rendering.RenderComponent.getCurrentFrameInfo ( )
  • Returns what frame info index should be displayed
    Returns
    The index of the current frame info

◆ getCurrentTexture()

Texture com.mygdx.game.engine.entities.components.rendering.RenderComponent.getCurrentTexture ( )

Gets the current texture being rendered.

Returns
The texture currently displayed on screen.

◆ getFlipX()

boolean com.mygdx.game.engine.entities.components.rendering.RenderComponent.getFlipX ( )

Returns whether the image is flipped Horizontally

Returns
true indicates it flips else it does not

◆ getFlipY()

boolean com.mygdx.game.engine.entities.components.rendering.RenderComponent.getFlipY ( )

Returns whether the image is flipped Vertically

Returns
true indicates it flips else it does not

◆ getInnerSortingLayer()

double com.mygdx.game.engine.entities.components.rendering.RenderComponent.getInnerSortingLayer ( )

Returns the sorting value in the entity its layer which it is sorted on.

Returns
The higher the value the later it is rendered (The opposite of the normal Sort Layer)

◆ getPivotX()

float com.mygdx.game.engine.entities.components.rendering.RenderComponent.getPivotX ( )

Gets the pivot point's x position. 0 being the far left side and 1 being the far right side of the image.

Returns
Pivot point's X range

◆ getPivotY()

float com.mygdx.game.engine.entities.components.rendering.RenderComponent.getPivotY ( )

Gets the pivot point's position. 0 being the bottom and 1 being the top of the image

Returns
Pivot point's Y range

◆ getRealHeight()

float com.mygdx.game.engine.entities.components.rendering.RenderComponent.getRealHeight ( )

Gets the height of the texture * the scaleY of the entity

Returns
The real height calculated with the texture height.

◆ getRealWidth()

float com.mygdx.game.engine.entities.components.rendering.RenderComponent.getRealWidth ( )

Gets the width of the texture * the scaleX of the entity

Returns
The real width calculated with the texture width.

◆ getRenderInfo()

RenderInfo com.mygdx.game.engine.entities.components.rendering.RenderComponent.getRenderInfo ( )

Gets the RenderInfo set in the RenderComponent to use for display.

Returns
RenderInfo of the RenderComponent

◆ getSortingLayer()

int com.mygdx.game.engine.entities.components.rendering.RenderComponent.getSortingLayer ( )

The sorting layer indicates the render layer of the entity. The higher the value, the more priority the entity has. (0 will be rendered under 1 and so on)

Returns
The sorting layer of the entity

◆ isSortedOnY()

boolean com.mygdx.game.engine.entities.components.rendering.RenderComponent.isSortedOnY ( )

Indicates whether the renderComponent is rendered in its layer on its y position.

Returns
true if its sorted on y position, else it returns false.

◆ isUserInterface()

boolean com.mygdx.game.engine.entities.components.rendering.RenderComponent.isUserInterface ( )

Returns whether this is rendered on the main camera or the hud camera

Returns
returns false when it is rendered on the main camera and true when rendered on the hud camera

◆ setAlpha()

void com.mygdx.game.engine.entities.components.rendering.RenderComponent.setAlpha ( float  alpha)

This sets the alpha of the Color which is modifying the current entity.

Parameters
alphato set the current modifying Color to.

◆ setCallsRenderAfterEntityRender()

void com.mygdx.game.engine.entities.components.rendering.RenderComponent.setCallsRenderAfterEntityRender ( boolean  renderAfterEntityRender)

Sets render order. If true, that means the 'Rendered' method in the Entity is called after this component is rendered. Else, if false, it will be called before

Parameters
renderAfterEntityRendermeans: True, it will call the 'rendered' method after the entity is rendered, else false

◆ setColor() [1/2]

void com.mygdx.game.engine.entities.components.rendering.RenderComponent.setColor ( Color  color)

This sets the color which is modifying the current entity. The color White equals its original color

Parameters
colorto set the value to.

◆ setColor() [2/2]

void com.mygdx.game.engine.entities.components.rendering.RenderComponent.setColor ( float  r,
float  g,
float  b,
float  a 
)

This sets the color which is modifying the current entity. The color White equals its original color

Parameters
ris the red channel to set (0 - 1)
gis the green channel to set (0 - 1)
bis the blue channel to set (0 - 1)
ais the alpha channel to set (0 - 1)

◆ setCurrentFrameInfo()

void com.mygdx.game.engine.entities.components.rendering.RenderComponent.setCurrentFrameInfo ( int  index)

Sets the frame info index which should be displayed

Parameters
indexis the index of the current frame info

◆ setCurrentTexture()

void com.mygdx.game.engine.entities.components.rendering.RenderComponent.setCurrentTexture ( Texture  texture)

Sets the current texture to render

Parameters
textureto set as new texture to render on screen.

◆ setFlipX()

void com.mygdx.game.engine.entities.components.rendering.RenderComponent.setFlipX ( boolean  flipX)

Sets whether the image should flip horizontally

Parameters
flipXtrue indicates it flips else it does not

◆ setFlipY()

void com.mygdx.game.engine.entities.components.rendering.RenderComponent.setFlipY ( boolean  flipY)

Sets whether the image should flip vertically

Parameters
flipYtrue indicates it flips else it does not

◆ setPivot()

void com.mygdx.game.engine.entities.components.rendering.RenderComponent.setPivot ( float  pivotX,
float  pivotY,
boolean  keepPosition 
)

Sets the pivot point to the new value. X = 0 being the far left side and 1 being the far right side of the image. Y = 0 being the bottom and 1 being the top of the image

Parameters
pivotXthe new x Pivot value
pivotYthe new y Pivot value
keepPositionmeans that it will keep its current render position and move the object data position to do so.

◆ setRenderInfo()

void com.mygdx.game.engine.entities.components.rendering.RenderComponent.setRenderInfo ( RenderInfo  info)

Sets the current render info and cleans the previous one.

Parameters
infoto set as new RenderInfo for this component.

◆ setSortingLayer()

void com.mygdx.game.engine.entities.components.rendering.RenderComponent.setSortingLayer ( int  sortingLayer)

The sorting layer indicates the render layer of the entity. The higher the value, the more priority the entity has. (0 will be rendered under 1 and so on)

Parameters
sortingLayeris the new layer sorting value for the entity

◆ setSortOnY()

void com.mygdx.game.engine.entities.components.rendering.RenderComponent.setSortOnY ( boolean  sortOnY)

Sets if the entity should be rendered on its Y position.

Parameters
sortOnYtrue means it will be sorted on Y position, else it will not.

◆ updated()

void com.mygdx.game.engine.entities.components.rendering.RenderComponent.updated ( float  deltaTime)
protected

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