0
\$\begingroup\$

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?

\$\endgroup\$
0
\$\begingroup\$

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.

|improve this answer|||||
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.