Quantcast
Channel: Question and Answer » libgdx
Viewing all articles
Browse latest Browse all 434

How to “pause” stage actors listeners

$
0
0

I have a problem with multiple stages and listeners in libGDX. I have GameScreen with gameStage (contains game elements), uiStage (score label and pause button) and pauseStage (resume, restart and exit buttons).

And I have InputMultiplexer to which I add pauseStage, uiStage and anonymous listener in constructor. In result when user touches pause button, game stops and pause buttons appears on the screen. When he touches screen in other place, it’s handled as control of the game character.

But there is a problem – when playing, I don’t draw pauseStage but still when I click in the area when buttons from pauseStage would be if they were visible, this click is not handled. I tried a lot of ways but it’s not working. How to “pause” pauseStage buttons listeners while playing or do something to make pauseStage invisible?pauseStage.getRoot().setVisible() isn’t working…


Viewing all articles
Browse latest Browse all 434

Trending Articles