Hello,
I'm basically just wondering if there is a way to set isTouchEnabled on a layer from another layer.
Basically this is what I have.
Layer1
adds two other layers - Layer2 and Layer3
Layer2
handles touches to begin with - working well
Layer3
handle touches when it needs to
Now, I'm at work and not on my mac, but what I am trying to do is setup a 'menu' type layer that opens up on top of the other layer - I want only this menu layer to be touch enabled.
So, through Layer1, I load both layers (the menu one doesn't take up much memory) and I set Layer3 (menu layer) to have a greater Z value than Layer2 - so, it pops up in front.
Now, this works fine if I handle all the touches through Layer2, but I don't want to do that. I want Layer3 to handle touches.
I hope this makes sense.
Either way, I have tried to do something along the lines of:
Layer3.isTouchEnabled = YES;
Layer2.isTouchEnabled = NO;
It tells me I can't do this.
So, if I were to set a CocosNode in Layer1 for Layer2 and Layer3, is there a way to set something in that node to have isTouchEnabled changed?
If not, I'll have to explore other options. Any suggestions?
I hope this all makes sense. I can provide some code in a few hours.