0

I have a custom CCNode that I am using for providing notifications on a popup basis. I am trying to disable the background when the CCNode is popped up but allow user interaction on the new CCNode.

I can disable the parent UIView by using the following when the popup is called

[[[CCDirector sharedDirector] view] setUserInteractionEnabled:NO];

In the class for my custom CCNode notification I have the button set to the following to try and override the previous code so that the button is the only touchable event

_buttonOK.userInteractionEnabled = TRUE;

However this is not working and the whole view's user interaction is disabled. How would I override this to enable only the _buttonOK to be touchable?

Jogendra.Com
  • 6,394
  • 2
  • 28
  • 35
memyselfandmyiphone
  • 1,080
  • 4
  • 21
  • 43
  • The view is the container for all nodes, therefore disabling interaction on the view will disable interaction for all nodes. You have to disable interaction on the node(s) which should not receive touch events. If you have many such nodes, be sure to put them in the same parent node. – CodeSmile Jul 31 '14 at 12:23

1 Answers1

0

Thought it's not the prettiest way to do it, you can create a CCMenuItem with 100% width&height without any method. Everything under this CCMenuItem won't be clickable and you can add what you want as enabled on top of the CCMenuItem.

so... you would have something like:

Interaction Enabled Nodes > CCMenuItem without any method > Background without interaction.

Hope it helps :)

AlexVogel
  • 10,601
  • 10
  • 61
  • 71
Kalvin
  • 71
  • 4