(Tiled) Background stops being rendered in libGDX

Game Development Asked by xmac on December 21, 2021

I’m using Tiled and I created my background as an image in a Tile Layer.
When I load the map in LibGDX, it shows fine. However when the camera moves, the whole background dissapears.

The problem is solved if I add the background as an Image Layer.

Any idea what’s causing the problem in the Tile Layer?

One Answer

Likely libgdx optimizes the rendering process by rendering only those tiles that are within your viewport. Your background tile is very large, but libgdx may be assuming that all tiles match with the grid size of your map. Then, as soon as that small area is outside of the view, it stops rendering the entire tile.

I guess you could just use an image layer instead, since this solves your problem? Another solution would be to place your background image as multiple tiles.

Answered by Thorbjørn Lindeijer on December 21, 2021

Add your own answers!

Related Questions

Resizing a tiledmap when using phaser

1  Asked on December 16, 2020 by sora


Prefab spawning issue

2  Asked on December 15, 2020 by usmaan-mahmood


Pause updating but keep rendering

1  Asked on December 5, 2020 by yosoku-denkai


How to make it so my cursor is not behind the UI?

0  Asked on December 3, 2020 by jacksonba90


Can’t submit facebook app for review

2  Asked on November 20, 2020 by moria


OpenGL Strange mesh when animating Assimp

1  Asked on October 26, 2020 by david-neves


2D Sidescroller Gravity

1  Asked on October 22, 2020 by pete-mavrelis


Can I “unmerge” merged meshes UE4?

0  Asked on September 22, 2020 by formatc2013


unity : How to delete unused assets?

0  Asked on September 6, 2020 by andio


Ask a Question

Get help from others!

© 2022 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir