简体   繁体   中英

In Cocos2d, with buttons on multiple layers, how can I control which button to react to user's touch?

Now I have a CCLayer of gameplay, where there are a few buttons. And I want to pop up a dialog layer, where there are also a few buttons. How can I deactivate the background buttons and only make the foreground buttons activated?

Use CCMenuItem setIsEnabled method to disable button.

What about a lot of buttons on gameplay? Disable every button looks like not the best solution... Is it possible to disactivate all buttons in one fell swoop as topic starter requested?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM