public class AnimatedTileRenderer extends java.lang.Object implements TileRenderer
TileRenderer for animated tiles| Modifier and Type | Field and Description |
|---|---|
static int |
RENDERER_TYPE |
| Constructor and Description |
|---|
AnimatedTileRenderer(TilesetSource tilesetSource,
TileFrame[] frames) |
| Modifier and Type | Method and Description |
|---|---|
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 |
boolean |
equals(java.lang.Object o) |
static AnimatedTileRenderer |
fromInputStream(TilesetSource tilesetSource,
java.io.DataInputStream inputStream) |
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 AnimatedTileRenderer(TilesetSource tilesetSource, TileFrame[] frames)
public static AnimatedTileRenderer fromInputStream(TilesetSource tilesetSource, java.io.DataInputStream inputStream) throws java.io.IOException
java.io.IOExceptionpublic 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 int getRendererType()
getRendererType in interface TileRendererpublic void dispose()
dispose in interface org.mini2Dx.gdx.utils.Disposablepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object