The method call of stateManager.start(mainMenuPresenter); gets propagated through to a this.setActive(true) in MainMenuView, however the Gamestate does not appear as active when queried with:
This is of course at the moment only a minor hindrance because when i set the state to active manually, it does appear as active. However the most pressing problem is: Nothing gets rendered to the screen. Here is my gamestate:
public class MainMenuView extends BasicGameState implements IMainMenuView {
after telling this forum of my problem and despair I found the mistake I made. I use Guice for dependency injection and attached two instances of the same GameState to the GameStateManager. It didn't work out of course. So after scoping my GameStates as singletons everything works like a charm. Thank You all for listening!
I don't know how I missed this topic, could've been vacation… but your Singleton approach is correct. I've used GBUI in many GameState works without a problem.
I’m using StandardGame. i have two game states - Menu (with gbui, i started working on it ) ang Game (with the rest). At start i’m creating only a menu state and it shows corectly (look here for screen shot http://img25.imageshack.us/img25/4288/200908301836041280x800s.png ).
Then if i press “Start game” button, it creates the second GameState “Game” and activates only that GameState. It’s also work ok.
Did you write the code or pull it from the atechnique source? (not accusatory, just asking) There's a bug that I've not identified where yet and it's highly prevalent in aTechnique as well with GameState. I'll look at your code today and see if I can debug to figure out what's going on…I'm pretty sure it's not going to be with your code, but an existing bug in GBUI that I've been looking at. Well, actually, I've been out of town and net-less for 3 weeks, but before I left I was looking at it.