Peter Poliwoda
Peter Poliwoda

Reputation: 699

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.

Upvotes: 4

Views: 2584

Answers (1)

sam
sam

Reputation: 4397

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

Upvotes: 10

Related Questions