Bandidos
Public Member Functions | List of all members
com.mygdx.game.engine.entities.components.rendering.RenderInfo Class Reference

Public Member Functions

 RenderInfo (Texture texture)
 
 RenderInfo (Texture texture, FrameInfo[] frames)
 
FrameInfo [] getAllFrameInfos ()
 
int getFramesLength ()
 
Texture getTextureToDraw ()
 
int getStartX (int frameInfoIndex)
 
int getStartY (int frameInfoIndex)
 
int getCutWidth (int frameInfoIndex)
 
int getCutHeight (int frameInfoIndex)
 
Vector2 getInnerOffset ()
 
void setInnerOffset (float xOffset, float yOffset)
 
void clean ()
 

Detailed Description

This is a class holding a texture to display and what part of the texture to display

Author
Ramses Di Perna

Constructor & Destructor Documentation

◆ RenderInfo() [1/2]

com.mygdx.game.engine.entities.components.rendering.RenderInfo.RenderInfo ( Texture  texture)

Shows the entire picture given

Parameters
textureto display

◆ RenderInfo() [2/2]

com.mygdx.game.engine.entities.components.rendering.RenderInfo.RenderInfo ( Texture  texture,
FrameInfo []  frames 
)

Shows a part of the texture given. All other info is given in pixels.

Parameters
textureto show partly
cutPosXis where the cutting should start in the x axis
cutPosYis where the cutting should start in the y axis
frameSizeXis how much it should cut starting from the cutPosX
frameSizeYis how much it should cut starting from the cutPosY

Member Function Documentation

◆ clean()

void com.mygdx.game.engine.entities.components.rendering.RenderInfo.clean ( )

Cleans the data in the RenderInfo Class.

◆ getAllFrameInfos()

FrameInfo [] com.mygdx.game.engine.entities.components.rendering.RenderInfo.getAllFrameInfos ( )

Returns all the FrameInfos linked in the RenderInfo

Returns
All FrameInfos of the RenderInfo

◆ getCutHeight()

int com.mygdx.game.engine.entities.components.rendering.RenderInfo.getCutHeight ( int  frameInfoIndex)

Returns the height it should cut from the start position.

Returns
The height it should cut from the start position.

◆ getCutWidth()

int com.mygdx.game.engine.entities.components.rendering.RenderInfo.getCutWidth ( int  frameInfoIndex)

Returns the width it should cut from the start position.

Returns
The width it should cut from the start position.

◆ getFramesLength()

int com.mygdx.game.engine.entities.components.rendering.RenderInfo.getFramesLength ( )

Returns the amount of frame info classes this render info contains.

Returns
The amount of frame infos

◆ getInnerOffset()

Vector2 com.mygdx.game.engine.entities.components.rendering.RenderInfo.getInnerOffset ( )

Affects the rendering. Default (0,0) keeps the RenderInfo at normal space. 1 draws it its mass to one side, and -1 to the opposite.

Returns
The inner offset value for the rendering.

◆ getStartX()

int com.mygdx.game.engine.entities.components.rendering.RenderInfo.getStartX ( int  frameInfoIndex)

Returns the X axis start cutting coordinates for the texture.

Returns
The X axis start cutting coordinates for the texture.

◆ getStartY()

int com.mygdx.game.engine.entities.components.rendering.RenderInfo.getStartY ( int  frameInfoIndex)

Returns the Y axis start cutting coordinates for the texture.

Returns
The Y axis start cutting coordinates for the texture.

◆ getTextureToDraw()

Texture com.mygdx.game.engine.entities.components.rendering.RenderInfo.getTextureToDraw ( )

Returns the full texture to draw

Returns
the entire texture to draw

◆ setInnerOffset()

void com.mygdx.game.engine.entities.components.rendering.RenderInfo.setInnerOffset ( float  xOffset,
float  yOffset 
)

Sets the inner offset of this RenderInfo If its 0,0. Its unaffected. If the x is set to 0.5. The texture will be drawn half his width offset to the right. etc

Parameters
xOffsetnormalized value of how much to put offset in the x axis using the value of the texture width
yOffsetnormalized value of how much to put offset in the y axis using the value of the texture height

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