Starling / Stage3d从舞台上卸载游戏

时间:2013-03-30 14:53:18

标签: flex stage3d starling-framework

我有一个灵活的应用程序,它加载一个stage3D(椋鸟)游戏。 所有工作都很好,直到这一点,我能够隐藏应用程序并只显示游戏层,但问题到达时游戏结束,我想返回到flex应用程序并从舞台中删除游戏。

我确实试图停止游戏并从stage3d移除所有孩子,但这不能正常工作,下次我尝试重新显示游戏时它没有显示。

以下是我正在使用的一些代码

添加游戏并开始游戏(一切正常)

starlingGame                = new Starling(Game, this.systemManager.stage);
starlingGame.antiAliasing   = 0;
starlingGame.start();
starlingGame.showStats      = true;
// this event is dispatched when stage3D is set up
starlingGame.stage3D.addEventListener(Event.CONTEXT3D_CREATE, onContextCreated);

以下是我尝试删除/卸载游戏的方法 - 由于某些原因,这是第一次使用,但后面的代码不会使游戏第二次显示:(

starlingGame.stop();
starlingGame.removeEventListener(Event.CONTEXT3D_CREATE, onContextCreated);
starlingGame.stage.removeChildren();
starlingGame    = null;

0 个答案:

没有答案
相关问题