Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I add an actor to the back layer in Libgdx?

I am making a game in Libgdx and I have a little problem. I have a number of actors that show up on the screen dynamically. If there is an Image actor that shows up after the first, could I send it to the back so that it doesn't cover the first one that is already on the screen?

Usually Libgdx adds each new actor higher in hierarchy like a stack and brings every one to the front.

like image 268
Peter Poliwoda Avatar asked Dec 27 '22 11:12

Peter Poliwoda


1 Answers

Try the following methods in the Actor class: toFront(), toBack() & setZIndex()

like image 126
sam Avatar answered Jan 08 '23 20:01

sam