我想在引擎中创建一个屏幕上的暂停按钮
我现在做的是添加一个精灵,当我触摸它时,我做engine.stop(),这个问题是,引擎不处理更多的touchevents,直到我恢复游戏(现在我使用菜单按钮这个),那么有没有办法实现它?
谢谢!
I want to create an onscreen pause button in andengine
What I do now is add an sprite and when I touch it, I do engine.stop(), the problem with this, is that the engine doesn't handle more touchevents till I resume the game (now I use the menu button for this), so is there a way to achieve it?
Thanks!
最满意答案
看看AndEngine的例子,有一个项目显示了AndEngine中菜单的使用,你会找到一个更好的方式来实现一个菜单,而不是停止引擎。 祝你好运!
I found the best way to do it is creating an scene, and when paused, set override the onManagedUpdate this way
@Override onManagedUpdate(float pSecondsElapsed){ if(mPaused) super.onManagedUpdate(0); else super.onManagedUpdate(pSecondsElapsed); }This way everything works perfectly, and you can do it on a game layer and have the menu layer updated as usual,
更多推荐
发布评论