I make a MenuScene when my Game loads, which grabs some intro text from levelData and displays it and a button to start playing the level. When the MenuScene is created and displayed in onLoadComplete() it's fine. However when I display it again when advancing the level (levelData is loaded with new data and the MenuScene reset) it freezes, showing the game at the point the level was beaten. The menu is not displayed at all. I'm just calling
loadIntro();
this.mScene.setChildScene(this.mIntroScene, false, true, true);
this.mEngine.stop();
to display the MenuScene (the same both times, it works the first time but not the second), where loadIntro() is
private void loadIntro() {
this.mIntroScene = new MenuScene(this.mCamera);
final TextMenuItem intro = new TextMenuItem(-1, mFont, levelData.getIntroText());
intro.setBlendFunction(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
intro.setSize(400, 150);
this.mIntroScene.addMenuItem(intro);
final SpriteMenuItem startMenuItem = new SpriteMenuItem(MENU_START, this.mMenuStartTextureRegion);
startMenuItem.setBlendFunction(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
this.mIntroScene.addMenuItem(startMenuItem);
this.mIntroScene.buildAnimations();
this.mIntroScene.setBackgroundEnabled(false);
this.mIntroScene.setOnMenuItemClickListener(this);
}
What am I doing wrong?