Class AnimatedTiledMapTile

  • All Implemented Interfaces:
    TiledMapTile

    public class AnimatedTiledMapTile
    extends java.lang.Object
    implements TiledMapTile
    • Constructor Detail

      • AnimatedTiledMapTile

        public AnimatedTiledMapTile​(float interval,
                                    Array<StaticTiledMapTile> frameTiles)
        Creates an animated tile with the given animation interval and frame tiles.
        Parameters:
        interval - The interval between each individual frame tile.
        frameTiles - An array of StaticTiledMapTiles that make up the animation.
      • AnimatedTiledMapTile

        public AnimatedTiledMapTile​(IntArray intervals,
                                    Array<StaticTiledMapTile> frameTiles)
        Creates an animated tile with the given animation intervals and frame tiles.
        Parameters:
        intervals - The intervals between each individual frame tile in milliseconds.
        frameTiles - An array of StaticTiledMapTiles that make up the animation.
    • Method Detail

      • setId

        public void setId​(int id)
        Specified by:
        setId in interface TiledMapTile
      • getCurrentFrameIndex

        public int getCurrentFrameIndex()
      • getOffsetX

        public float getOffsetX()
        Specified by:
        getOffsetX in interface TiledMapTile
        Returns:
        the amount to offset the x position when rendering the tile
      • setOffsetX

        public void setOffsetX​(float offsetX)
        Description copied from interface: TiledMapTile
        Set the amount to offset the x position when rendering the tile
        Specified by:
        setOffsetX in interface TiledMapTile
      • getOffsetY

        public float getOffsetY()
        Specified by:
        getOffsetY in interface TiledMapTile
        Returns:
        the amount to offset the y position when rendering the tile
      • setOffsetY

        public void setOffsetY​(float offsetY)
        Description copied from interface: TiledMapTile
        Set the amount to offset the y position when rendering the tile
        Specified by:
        setOffsetY in interface TiledMapTile
      • getAnimationIntervals

        public int[] getAnimationIntervals()
      • setAnimationIntervals

        public void setAnimationIntervals​(int[] intervals)
      • updateAnimationBaseTime

        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()