public class StaticTileRenderer extends java.lang.Object implements TileRenderer
TileRenderer for single tile images| Modifier and Type | Field and Description |
|---|---|
static int |
RENDERER_TYPE |
| Modifier and Type | Method and Description |
|---|---|
static StaticTileRenderer |
create(TilesetSource tilesetSource) |
void |
dispose() |
void |
draw(Graphics g,
Tile tile,
int renderX,
int renderY,
float alpha)
Renders the
Tile at the given coordinates |
void |
draw(Graphics g,
Tile tile,
int renderX,
int renderY,
float alpha,
boolean flipH,
boolean flipV,
boolean flipD)
Renders the
Tile at the given coordinates |
static void |
drawTileImage(Graphics g,
Sprite tileImage,
int renderX,
int renderY,
float alpha,
boolean flipH,
boolean flipV,
boolean flipD) |
boolean |
equals(java.lang.Object o) |
static StaticTileRenderer |
fromInputStream(TilesetSource tilesetSource,
Tile tile) |
Sprite |
getCurrentTileImage(Tile tile)
Returns the current
Tile image |
int |
getRendererType() |
int |
hashCode() |
void |
readData(java.io.DataInputStream inputStream)
Deserializes this object from a
DataInputStream |
void |
update(Tile tile,
float delta)
Updates the
Tile frame |
void |
writeData(java.io.DataOutputStream outputStream)
Serializes this object to a
DataOutputStream |
public static final int RENDERER_TYPE
public static StaticTileRenderer create(TilesetSource tilesetSource)
public static StaticTileRenderer fromInputStream(TilesetSource tilesetSource, Tile tile)
public void writeData(java.io.DataOutputStream outputStream)
throws java.io.IOException
GameDataSerializableDataOutputStreamwriteData in interface GameDataSerializableoutputStream - The DataOutputStream to write tojava.io.IOException - Thrown if an error occurs during I/Opublic void readData(java.io.DataInputStream inputStream)
throws java.io.IOException
GameDataSerializableDataInputStreamreadData in interface GameDataSerializableinputStream - The DataInputStream to read fromjava.io.IOException - Thrown if an error occurs during I/Opublic void update(Tile tile, float delta)
TileRendererTile frameupdate in interface TileRenderertile - The Tile to updatedelta - The time since the last update in secondspublic void draw(Graphics g, Tile tile, int renderX, int renderY, float alpha)
TileRendererTile at the given coordinatesdraw in interface TileRendererg - The Graphics context to usetile - The Tile to renderrenderX - The x coordinate to render atrenderY - The y coordinate to render atalpha - The alpha value to render withpublic void draw(Graphics g, Tile tile, int renderX, int renderY, float alpha, boolean flipH, boolean flipV, boolean flipD)
TileRendererTile at the given coordinatesdraw in interface TileRendererg - The Graphics context to usetile - The Tile to renderrenderX - The x coordinate to render atrenderY - The y coordinate to render atalpha - The alpha value to render withflipH - True if the tile is flipped horizontallyflipV - True if the tile is flipped verticallyflipD - True if the tile is flipped (anti) diagonally - rotationpublic Sprite getCurrentTileImage(Tile tile)
TileRendererTile imagegetCurrentTileImage in interface TileRenderertile - The Tile to get the image forpublic void dispose()
dispose in interface org.mini2Dx.gdx.utils.Disposablepublic static void drawTileImage(Graphics g, Sprite tileImage, int renderX, int renderY, float alpha, boolean flipH, boolean flipV, boolean flipD)
public int getRendererType()
getRendererType in interface TileRendererpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object