0

In my application I need to switch frequently between two main screens (tripleplay.game.Screen)

In order to toggle between the two screens, I always keep one Screen on the tripleplay.game.ScreenStack and I push/remove the second Screen to/from ScreenStack. This cause a lot of calls to wasAdded()/wasRemoved() methods of the second screen.

To avoid performance degradation I choosen to do nothing in the wasRemoved() method and I put an alreadyCreated flag on the MyScreen class to avoid execution of the logic contained in the wasAdded() method.

Is it possible to switch between two screens already on the ScreenStack without removing the topmost screen but simply swapping positions of the screens inside the stack?

Thanks in advance, Gio

Gio
  • 94
  • 5
  • I'm not sure about what you're talking about, but it looks like you may want to look up what double buffering is. – zmo Jun 05 '13 at 10:58
  • I probably bad explained. I'm simply using the Screen class of the tripleplay library to manage two use case of my game. When the user toggle between the two screens, I don't want to push and pop from the ScreenStack everytime. So I was looking for a method to swap the position of the two screens on the stack – Gio Jun 06 '13 at 09:57

0 Answers0