backspacer
backspacer

Reputation: 938

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?

Upvotes: 1

Views: 515

Answers (2)

Alex
Alex

Reputation: 1

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?

Upvotes: 0

Andrew
Andrew

Reputation: 24846

Use CCMenuItem setIsEnabled method to disable button.

Upvotes: 3

Related Questions