I am writing a Tower Defense for Android. Right now my LevelScreen contains a Background-Actor which is pan-able and some zones to buy Towers - after buying them you can upgrade them further. When you click a Zone or a Tower, a small overlay on the bottom appears (another actor) - click it to buy. My main Problem was that the overlay stayed where you clicked and didn't move when you pan the Screen. I solved this by changing the overlay's draw method to
batch.setProjectionMatrix(game.batch.getProjectionMatrix()); batch.draw(texture,actorX,actorY); batch.setProjectionMatrix(levelScreen.stage.getCamera().combined);
I set it backwards for further Actors who should stay where they are - Towers for example - but I kinda don't know what I am really doing.
I am now only able to fire the touchDown Event on these actors when I pan to the bottom left of the Screen and click where the Actor's Icon is.
I tried a few things:
-Adding another Stage as a HUD(I couldn't Access the lower stage anymore or the other way around)
-Moving the actor.x and actor.y along (I was unable to even find where the actor went)
-Adding another camera (led to nothing)
-Updating the actors Position using
(same as when I tried to move the actor)
So, which is a good way to implement what I look for? Basically, TL;DR: I am looking for a way of letting some Actors stay relative to Screen while moving some Actors with the world while panning around.
I am pretty sure there a similar questions but None of them really helped me and I have restricted Internet-Access (for example I can't Access badlogicgames.com).