TransWikia.com

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

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP