How to drag layers in sync
I have a layer and several child layer to this main layer. I can drag each child layer separately using ccTouchMoved method. I need to drag the main layer so the other layers will 开发者_StackOverflow中文版follow, but how Can I drag the main layer through the ccTouchMoved? Thank you.
You can drag the main layer in the same way you can drag the child layers
Either, you can have a child layer accept the ccTouchMoved and then have that layer send a message to the parent. parent.position = CGPointMake(x, y)
in example
Or, you can have the child layers ignore the ccTouchMoved event until it's propagated to the main layer (which obviously has to be touch enabled for this to work)
精彩评论