cocos2d.如何创建弹出模式对话框(使用 CCLayer) [英] cocos2d. How to create a popup modal dialog (with CCLayer)

查看:26
本文介绍了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屋!

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