APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.maps.tiled.tiles

public Class AnimatedTiledMapTile

extends Object
implements TiledMapTile
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.maps.tiled.TiledMapTile
Imports
com.badlogic.gdx.graphics.g2d.TextureRegion, com.badlogic.gdx.maps.MapObjects, .MapProperties, com.badlogic.gdx.maps.tiled.TiledMapTile, com.badlogic.gdx.utils.Array, .GdxRuntimeException, .IntArray, .TimeUtils

@brief Represents a changing TiledMapTile.

Field Summary

Modifier and TypeField and Description
private int[]
private TiledMapTile.BlendMode
private StaticTiledMapTile[]
private int
private static final long
private static long
private int
private MapObjects
private MapProperties

Constructor Summary

AccessConstructor and Description
public
AnimatedTiledMapTile(float
The interval between each individual frame tile.
interval
,
Array<StaticTiledMapTile>
An array of StaticTiledMapTiles that make up the animation.
frameTiles
)

Creates an animated tile with the given animation interval and frame tiles.

public
AnimatedTiledMapTile(IntArray
The intervals between each individual frame tile in milliseconds.
intervals
,
Array<StaticTiledMapTile>
An array of StaticTiledMapTiles that make up the animation.
frameTiles
)

Creates an animated tile with the given animation intervals and frame tiles.

Method Summary

Modifier and TypeMethod and Description
public int[]
public TiledMapTile.BlendMode
public TiledMapTile
public int
public StaticTiledMapTile[]
public int
public MapObjects
public float
public float
public MapProperties
public TextureRegion
public void
setAnimationIntervals(int[] intervals)

public void
setBlendMode(TiledMapTile.BlendMode blendMode)

Implements com.badlogic.gdx.maps.tiled.TiledMapTile.setBlendMode.

Sets the BlendMode to use for rendering the tile

public void
public void
setOffsetX(float offsetX)

Implements com.badlogic.gdx.maps.tiled.TiledMapTile.setOffsetX.

Set the amount to offset the x position when rendering the tile

public void
setOffsetY(float offsetY)

Implements com.badlogic.gdx.maps.tiled.TiledMapTile.setOffsetY.

Set the amount to offset the y position when rendering the tile

public void
setTextureRegion(TextureRegion textureRegion)

Implements com.badlogic.gdx.maps.tiled.TiledMapTile.setTextureRegion.

Sets the texture region used to render the tile

public static void
updateAnimationBaseTime()

Function is called by BatchTiledMapRenderer render(), lastTiledMapRenderTime is used to keep all of the tiles in lock-step animation and avoids having to call TimeUtils.millis() in getTextureRegion()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

animationIntervalsback to summary
private int[] animationIntervals
blendModeback to summary
private TiledMapTile.BlendMode blendMode
frameTilesback to summary
private StaticTiledMapTile[] frameTiles
idback to summary
private int id
initialTimeOffsetback to summary
private static final long initialTimeOffset
lastTiledMapRenderTimeback to summary
private static long lastTiledMapRenderTime
loopDurationback to summary
private int loopDuration
objectsback to summary
private MapObjects objects
propertiesback to summary
private MapProperties properties

Constructor Detail

AnimatedTiledMapTileback to summary
public AnimatedTiledMapTile(float interval, Array<StaticTiledMapTile> frameTiles)

Creates an animated tile with the given animation interval and frame tiles.

Parameters
interval:float

The interval between each individual frame tile.

frameTiles:Array<StaticTiledMapTile>

An array of StaticTiledMapTiles that make up the animation.

AnimatedTiledMapTileback to summary
public AnimatedTiledMapTile(IntArray intervals, Array<StaticTiledMapTile> frameTiles)

Creates an animated tile with the given animation intervals and frame tiles.

Parameters
intervals:IntArray

The intervals between each individual frame tile in milliseconds.

frameTiles:Array<StaticTiledMapTile>

An array of StaticTiledMapTiles that make up the animation.

Method Detail

getAnimationIntervalsback to summary
public int[] getAnimationIntervals()
getBlendModeback to summary
public TiledMapTile.BlendMode getBlendMode()

Implements com.badlogic.gdx.maps.tiled.TiledMapTile.getBlendMode.

Annotations
@Override
getCurrentFrameback to summary
public TiledMapTile getCurrentFrame()
getCurrentFrameIndexback to summary
public int getCurrentFrameIndex()
getFrameTilesback to summary
public StaticTiledMapTile[] getFrameTiles()
getIdback to summary
public int getId()

Implements com.badlogic.gdx.maps.tiled.TiledMapTile.getId.

Annotations
@Override
getObjectsback to summary
public MapObjects getObjects()

Implements com.badlogic.gdx.maps.tiled.TiledMapTile.getObjects.

Annotations
@Override
getOffsetXback to summary
public float getOffsetX()

Implements com.badlogic.gdx.maps.tiled.TiledMapTile.getOffsetX.

Annotations
@Override
getOffsetYback to summary
public float getOffsetY()

Implements com.badlogic.gdx.maps.tiled.TiledMapTile.getOffsetY.

Annotations
@Override
getPropertiesback to summary
public MapProperties getProperties()

Implements com.badlogic.gdx.maps.tiled.TiledMapTile.getProperties.

Annotations
@Override
getTextureRegionback to summary
public TextureRegion getTextureRegion()

Implements com.badlogic.gdx.maps.tiled.TiledMapTile.getTextureRegion.

Annotations
@Override
setAnimationIntervalsback to summary
public void setAnimationIntervals(int[] intervals)
setBlendModeback to summary
public void setBlendMode(TiledMapTile.BlendMode blendMode)

Implements com.badlogic.gdx.maps.tiled.TiledMapTile.setBlendMode.

Doc from com.badlogic.gdx.maps.tiled.TiledMapTile.setBlendMode.

Sets the BlendMode to use for rendering the tile

Annotations
@Override
setIdback to summary
public void setId(int id)

Implements com.badlogic.gdx.maps.tiled.TiledMapTile.setId.

Annotations
@Override
setOffsetXback to summary
public void setOffsetX(float offsetX)

Implements com.badlogic.gdx.maps.tiled.TiledMapTile.setOffsetX.

Doc from com.badlogic.gdx.maps.tiled.TiledMapTile.setOffsetX.

Set the amount to offset the x position when rendering the tile

Annotations
@Override
setOffsetYback to summary
public void setOffsetY(float offsetY)

Implements com.badlogic.gdx.maps.tiled.TiledMapTile.setOffsetY.

Doc from com.badlogic.gdx.maps.tiled.TiledMapTile.setOffsetY.

Set the amount to offset the y position when rendering the tile

Annotations
@Override
setTextureRegionback to summary
public void setTextureRegion(TextureRegion textureRegion)

Implements com.badlogic.gdx.maps.tiled.TiledMapTile.setTextureRegion.

Doc from com.badlogic.gdx.maps.tiled.TiledMapTile.setTextureRegion.

Sets the texture region used to render the tile

Annotations
@Override
updateAnimationBaseTimeback to summary
public static void updateAnimationBaseTime()

Function is called by BatchTiledMapRenderer render(), lastTiledMapRenderTime is used to keep all of the tiles in lock-step animation and avoids having to call TimeUtils.millis() in getTextureRegion()