cocos2d。如何创建弹出式模态对话框(使用CCLayer) [英] cocos2d. How to create a popup modal dialog (with CCLayer)
本文介绍了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.
这篇关于cocos2d。如何创建弹出式模态对话框(使用CCLayer)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文