Window borders appearing in wrong GameState [FengGUI problem?]

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 !

I remember i also clicked into my FengGUI GameState while being in Game :slight_smile:



This is my FengMenuGameStates's  setActive Method(), it also activates/deactivates the FengJMEInputHandler.


    public final void setActive(final boolean active) {
        super.setActive(active);
        if (active == false) {
            MouseInput.get().setCursorVisible(false);
            input.setEnabled(false);
            return;
        }
        input.setEnabled(true);
        MouseInput.get().setCursorVisible(true);


it doesnt works… :confused:



i am thinking in use JMESwing…

i am having a few problems trying to implement FengGUI in my game…

yes you need a few workarounds to get FengGUI going,  maybe you can give GBUI a try.