BasicGameState & BasicGameStateNode graphic conflict

Hello, im trying use a BasicGameStateNode with  BasicGameState childs



The problem is that add a full-screen size quad to rootNode, and later instance and attach a child gamestate, that he implement some other minors quads as buttons. and only can see the first full-screen size quad only, i cant see the buttons quad, then i try comment the buildBackround() method and surprise! i can see now all buttons, then i think that this buttons are drawing back the big background quad.



Why is this? what im doing bad?







This is my BasicGameStateNode

(Implement only a background, and later attach and active the children)


public class MenuState extends BasicGameStateNode <BasicGameState> {
   
   public MenuState() {
      super("menuState");
      this.getRootNode().setRenderQueueMode(Renderer.QUEUE_ORTHO);
      this.buildBackground();
      MainMenuState mainMenuState = new MainMenuState();
      this.attachChild(mainMenuState);
      this.activateChildNamed("mainMenuState");
      this.getRootNode().updateRenderState();
   }
   
   private void buildBackground() {
      Texture t = TextureManager.loadTexture(
                MainMenuState.class.getClassLoader()
                   .getResource("res/woodBckg.png"),
                Texture.MinificationFilter.Trilinear,
                Texture.MagnificationFilter.Bilinear);
      
      Quad bckgQuad = new Quad("bckgQuad", 1024, 600);
        TextureState ts = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
        ts.setTexture(t);
        bckgQuad.setRenderState(ts);
      bckgQuad.setLocalTranslation(512, 300, 0);
        this.getRootNode().attachChild(bckgQuad);
   }
}




Children BasicGameState that implement minors quad buttons

public class MainMenuState extends BasicGameState {

   private BlendState blendState;
   private Button[] buttons;
   private int focusedButton;
   private TextureState font;
   
   public MainMenuState() {
      super("mainMenuState");
      this.getRootNode().setRenderQueueMode(Renderer.QUEUE_ORTHO);

      this.buildLogo();
      this.buildButtons();
      this.buildText();
                this.getRootNode().updateRenderState();
   }

   private void buildLogo() {       
      Texture t = TextureManager.loadTexture(
            MainMenuState.class.getClassLoader()
               .getResource("res/gameLogo.png"),
               Texture.MinificationFilter.Trilinear,
               Texture.MagnificationFilter.Bilinear);
      
      Quad logoQuad = new Quad("logoQuad", 512, 256);
      TextureState ts = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
      ts.setTexture(t);
      logoQuad.setLocalTranslation(250, 450, 0);
      logoQuad.setRenderState(ts);
      this.getRootNode().attachChild(logoQuad);
   }

   private void buildButtons() {
      // Create buttons
        this.buttons = new Button[3];
        this.buttons[0] = new Button("creditsButton", 256, 256,
                                "res/credits0.png", "res/credits1.png");
        this.buttons[1] = new Button("quitButton", 256, 256,
                                "res/quit0.png", "res/quit1.png");
        this.buttons[2] = new Button("newButton", 256, 256,
                                "res/new0.png", "res/new1.png");
      // Set translations, attach and set focus
      this.buttons[0].setLocalTranslation(300, 170, 0);
      this.buttons[1].setLocalTranslation(600, 420, 0);
      this.buttons[2].setLocalTranslation(860, 250, 0);
        for (int i = 0; i < this.buttons.length; i++) {
           this.buttons[i].setRenderState(this.blendState);
           this.getRootNode().attachChild(this.buttons[i]);
        }
        this.buttons[2].setFocus(true);
      this.focusedButton = 2;
   }
}
 

Look constructor of GameStateNode: (I think that are all good, dont know why the big quad cover all buttons.)



public MenuState() {

super("menuState");



                // FIRST BUILD BACKGROUND QUADS

this.getRootNode().setRenderQueueMode(Renderer.QUEUE_ORTHO);

this.buildBackground();



                // LATER CALL CONSTRUCTOR  CLASS OF BUTTONS

MainMenuState mainMenuState = new MainMenuState();

this.attachChild(mainMenuState);

this.activateChildNamed("mainMenuState");

this.getRootNode().updateRenderState();



              // THEN, THE BACKGROUND QUAD MUST BE BACK! NOT FORWARD BUTTONS

}


This is required for GameStateNode tree?



Because before i ever use one gamestate and i never have problem withour use this method,  in one gamestate the unique required condition is the sort when add spatials to rootnode.



Can you understand me? thie method is required only for when we have a GameStateNODE?





EDIT: I try create a ZState and use setZorder without success, i can see that only the spatials of BasicGameStateNode is drawed, and not the spatials of the child, BasicGameState



Really im too confused!

UPDATE:



The problem appear be FIXED when use setLocalTranslation(x, y, 1) in buttons,

with z 1 i can see the buttons over the background quad, without use zbuffer or setZorder method.



The next problem is… The BlendState that before run fine, the alphas textures now show the black background.

BlendState appear dont run.