I’m using Tiled with LibGDX and I have some animated tiles. When the game is paused I would like their animation to be paused as well. Is this possible?

The map is drawn with mapRenderer.render() and if I'm not mistake, this is the class responsible for getting the corresponding animation. There doesn't seem to be a way to freeze time. Any help appreciated, I've been searching for a couple of hours and cannot find anything.


1 Answer 1


It is not supported, but you can implement it. If you use an OrthogonalTiledMapRenderer than extend it and override the beginRender method (it updates animation time) (similar you can do for other TiledMapRenderer-s). Magic of open source is that you can inspect the code and find a way.

import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.maps.tiled.TiledMap;
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer;
import com.badlogic.gdx.maps.tiled.tiles.AnimatedTiledMapTile;

public class OrthogonalTiledMapRendererStopStartAnimated extends OrthogonalTiledMapRenderer {
  private boolean animate=true;
  public OrthogonalTiledMapRendererStopStartAnimated(TiledMap map) {

  public OrthogonalTiledMapRendererStopStartAnimated(TiledMap map, Batch batch) {
    super(map, batch);

  public OrthogonalTiledMapRendererStopStartAnimated(TiledMap map, float unitScale) {
    super(map, unitScale);

  public OrthogonalTiledMapRendererStopStartAnimated(TiledMap map, float unitScale, Batch batch) {
    super(map, unitScale, batch);

  protected void beginRender () {
    if (animate)

  public void setAnimate(boolean animate) {
    this.animate = animate;


And to use it:

mapRenderer = new OrthogonalTiledMapRendererStopStartAnimated(tiledMap, UNIT_SCALE);
mapRenderer.setAnimate(false); //TODO when you need 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .