public class Background
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static float |
TILE_HEIGHT
Stores the size of each tile in world units.
|
static float |
TILE_WIDTH
Stores the size of each tile in world units.
|
Constructor and Description |
---|
Background(float centerX,
float centerY)
Creates a new Background which contains a matrix of sprite tiles.
|
Modifier and Type | Method and Description |
---|---|
com.badlogic.gdx.graphics.g2d.Sprite |
getCenterTile()
Returns the tile in the center of the background.
|
com.badlogic.gdx.graphics.g2d.Sprite[][] |
getTiles()
Gets the matrix of tile sprites which represents and draws the background.
|
void |
setTiles(com.badlogic.gdx.graphics.g2d.Sprite[][] tiles)
Sets the matrix of tile sprites which represents and draws the background.
|
void |
shiftDown()
Shifts the tiles so that the top-most tiles migrate to the bottom of the background.
|
void |
shiftLeft()
Shifts the tiles so that the right-most tiles migrate to the left of the background.
|
void |
shiftRight()
Shifts the tiles so that the left-most tiles migrate to the right of the background.
|
void |
shiftUp()
Shifts the tiles so that the bottom-most tiles migrate to the top of the background.
|
public static final float TILE_WIDTH
public static final float TILE_HEIGHT
public Background(float centerX, float centerY)
public void shiftUp()
public void shiftDown()
public void shiftRight()
public void shiftLeft()
public com.badlogic.gdx.graphics.g2d.Sprite getCenterTile()
public com.badlogic.gdx.graphics.g2d.Sprite[][] getTiles()
public void setTiles(com.badlogic.gdx.graphics.g2d.Sprite[][] tiles)