public class DrawableObject
extends java.lang.Object
Constructor and Description |
---|
DrawableObject(com.badlogic.gdx.graphics.g2d.TextureRegion texture,
int xPos,
int yPos)
Initializes a new drawable object
|
DrawableObject(com.badlogic.gdx.graphics.g2d.TextureRegion texture,
int xPos,
int yPos,
int width,
int height,
int rotation)
Initializes a drawable object
|
DrawableObject(com.badlogic.gdx.graphics.g2d.TextureRegion texture,
int xPos,
int yPos,
int width,
int height,
int rotation,
boolean flipX,
boolean flipY)
Initializes a drawable object
|
Modifier and Type | Method and Description |
---|---|
boolean |
flipX()
Whether to flip the texture on the x-axis when rendering
|
boolean |
flipY()
Whether to flip the texture on the y-axis when rendering
|
int |
getHeight()
Gets the height of the object
|
int |
getRotation()
Gets the number of degrees to rotate the texture counterclockwise when rendering
|
com.badlogic.gdx.graphics.g2d.TextureRegion |
getTexture()
Gets the texture to use for drawing the object
|
int |
getWidth()
Gets the width of the object
|
int |
getXPosition()
Gets the x position the object should be drawn on
The x position should be in terms of the actual pixel position on the rendered game, not the position according
to the game tile.
|
int |
getYPosition()
Gets the y position the object should be drawn on
The y position should be in terms of the actual pixel position on the rendered game, not the position according
to the game tile.
|
public DrawableObject(com.badlogic.gdx.graphics.g2d.TextureRegion texture, int xPos, int yPos, int width, int height, int rotation, boolean flipX, boolean flipY)
texture
- The texture to use for drawing the elementxPos
- The pixel to start drawing on for the x axisyPos
- The pixel to start drawing on for the y axiswidth
- The width of the elementheight
- The height of the elementrotation
- The amount of degrees to rotate the element counterclockwiseflipX
- Whether to flip/mirror the element over the x axisflipY
- Whether to flip/mirror the element over the y axispublic DrawableObject(com.badlogic.gdx.graphics.g2d.TextureRegion texture, int xPos, int yPos, int width, int height, int rotation)
texture
- The texture to use for drawing the elementxPos
- The pixel to start drawing on for the x axisyPos
- The pixel to start drawing on for the y axiswidth
- The width of the elementheight
- The height of the elementrotation
- The amount of degrees to rotate the element counterclockwisepublic DrawableObject(com.badlogic.gdx.graphics.g2d.TextureRegion texture, int xPos, int yPos)
texture
- The texture to use for drawing the elementxPos
- The pixel to start drawing on for the x axisyPos
- The pixel to start drawing on for the y axispublic com.badlogic.gdx.graphics.g2d.TextureRegion getTexture()
public int getXPosition()
The x position should be in terms of the actual pixel position on the rendered game, not the position according to the game tile. E.g. (128,64) not (2,1).
public int getYPosition()
The y position should be in terms of the actual pixel position on the rendered game, not the position according to the game tile. E.g. (128,64) not (2,1).
public int getWidth()
public int getHeight()
public int getRotation()
public boolean flipX()
public boolean flipY()