hello!
i have a problem with changing GameStates… i am not sure what is causing the problem… but i will explain…
my game, has 5 stats (until now)… Intro, MainMenu, NewGameMenu, LoadGameMenu, and InGame…
ok… here is how they work…
Intro appers… and i press any key…
then Intro is setActive(false)… and MainMenu is Active…
i click in one option… MainMenu is DeActive… NewGameMenu is Active…
i click in another one… and NewGameMenu is DeActive… and InGame is active… and it starts to load the game components…
all works fine until now…
but in the InGameState… when i move the mouse… it shows a diferent mouse icon, right where is the Menu's border… like the Menu's still there, but invisible…
well… if i set all they setActive(false)… they shouldn't changes the mouse right??
and it bugs all my InGameState cause i am using the Lex's StrategicHandler, and i cant rotate with RightMouseButton…
i will show how my State codes are working…
Main:
GSManager = GameStateManager.getInstance();
GTQueueManager = GameTaskQueueManager.getManager();
disp = DisplaySystem.getDisplaySystem();
cam = disp.getRenderer().getCamera();
mouse = MouseInput.get();
keyboard = KeyInput.get();
inGameState = new InGameState("Jogo");
GSManager.attachChild(inGameState);
inGameState.setActive(false);
menuInicialState = new MenuInicialState("MenuInicial",loadState);
GSManager.attachChild(menuInicialState);
menuInicialState.setActive(false);
menuNovoJogoState = new MenuNovoJogoState("MenuNovoJogo",loadState);
GSManager.attachChild(menuNovoJogoState);
menuNovoJogoState.setActive(false);
introState = new IntroState("Intro");
GSManager.attachChild(introState);
introState.setActive(true);
mouse.setCursorVisible(true);
IntroState.java calling MainMenu in a keyinput
Main.introState.setActive(false);
Main.menuInicialState.setActive(true);
MainMenuState.java starts... its correct?
Callable<Object> call = new Callable<Object>() {
public Object call() throws Exception {
disp = new Display(new LWJGLBinding());
try {
Binding.getInstance().setUseClassLoader(true);
theme = new DefaultTheme();
} catch (Exception e1) {
e1.printStackTrace();
}
return null;
}
};
try {
Main.GTQueueManager.render(call).get();
} catch (Exception e) {
e.printStackTrace();
}
// Then a button calls NewGameState
Main.menuInicialState.setActive(false);
Main.menuNovoJogoState.setActive(true);
NewGameState.java, almost same MainMenu
Callable<Object> call = new Callable<Object>() {
public Object call() throws Exception {
disp = new Display(new LWJGLBinding());
try {
Binding.getInstance().setUseClassLoader(true);
theme = new DefaultTheme();
} catch (Exception e1) {
e1.printStackTrace();
}
return null;
}
};
try {
Main.GTQueueManager.render(call).get();
} catch (Exception e) {
e.printStackTrace();
}
//button call
Main.menuNovoJogoState.setActive(false);
Main.inGameState.setActive(true);
i dont understand what i have to do...
it isnt just DeActive the others States? then they cant been rendered
Thanks !