如何等待直到在目标C中按下CCMenuItemImage? [英] How to wait until the CCMenuItemImage is press in objective C?

查看:77
本文介绍了如何等待直到在目标C中按下CCMenuItemImage?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想暂停程序,直到按下按钮为止。

I want to pause the program until my button is press

我已经使用[[CCDirector sharedDirector] pause]暂停了场景;确保屏幕处于暂停状态,但我的功能正在继续运行,直到功能结束为止。

I have pause my scene by Use [[CCDirector sharedDirector] pause]; sure that the screen is pause but my function is continue running until it end function

它们是否有任何功能可以等待按下按钮的动作?

Do they have any function to wait for the press button action??

推荐答案

如果暂停CCDirector,它将使帧速率降至4 fps-不会停止CCDirector运行游戏更新,也不会停止当前方法的执行。

If you pause the CCDirector, it will drop the framerate to 4 fps - it does not stop the CCDirector from running game updates, nor will it halt the execution of the current method.

请注意,低帧率会影响触摸检测,您可能会发现在CCDirector暂停时很难激活任何CCMenu按钮。

Note that the low framerate will affect touch detection and you may find it hard to activate any CCMenu button while CCDirector is paused.

这只是CCDirector的pause方法不能很好地替代 real 暂停游戏的实现的两个原因。原则上,当您调出游戏中(暂停)菜单时,应该发生的情况是,任何游戏对象根本没有运行任何更新,而是暂停了任何当前正在运行的动作。仅前景菜单保持正常运行以接收用户输入。

These are just two reasons why CCDirector's pause method is a poor substitute for a real implementation of pausing your game. In principle, when you bring up the ingame (pause) menu, what should happen is that any game play object is simply not running any updates and pauses any currently running actions. Only the foreground menu remains running normally to receive user input.

这篇关于如何等待直到在目标C中按下CCMenuItemImage?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆