cocos2d。如何创建弹出式模态对话框(使用CCLayer)
问题描述:
我需要做一个模态对话框(继承自CCLayer),显示在主图层的中心。
在显示时,您不能在对话框外按任何其他按钮。
就像一个正常的模式窗口在MS Windows系统。
I need to make a modal dialog(inherited from CCLayer) that is showing in the center of the main layer. While it is showing, you can not press any other button outside the dialog. Just like a normal modal window in MS Windows System.
问题是,我不知道如何禁用主动的触摸事件,而对话框
The problem is that I can not figure out how to disable the mainlayer's touch events while the dialog is showing.
任何帮助将被禁止。
答
self.isTouchEnabled = NO;
。然后稍后将其重新设置为YES。
in the main layer while the popup is displayed. Then later set it back to YES.