Problem with touch detection priorities

Forums cocos2d games Problem with touch detection priorities

This topic contains 2 replies, has 2 voices, and was last updated by  nicobaca 1 year, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
Author Posts
Author Posts
December 7, 2012 at 1:12 pm #245641

nicobaca
Participant
@nicobaca

I have the following problem:

I have a CCLayer which receives touch events for handling panning and zooming.

The panning and zooming uses ccTouchesBegan:(NSSet *)touches method, it can not use one touch detection because of the panning and zooming gestures, that is why I am not registering to the shared touch dispatcher.

In that layer I have a class of my own which is of CCSprite type, I registered this class to CCTargetedTouchDelegate.

I want to be able to detect touch events on my class first and if my ccsprite has not been touched I want the cclayer to process the touch.

Is it possible to detect touch events first in my CCSprite class and then in my CCLayer?

I am not able to do this. Any suggestions?

December 7, 2012 at 1:26 pm #393350

Birkemose
Keymaster
@birkemose

Try lowering the priority of the sprite touch to a negative value.

December 7, 2012 at 1:52 pm #393351

nicobaca
Participant
@nicobaca

Ok, I will try doing that and give you an update.

Do you know if the objects that are registered to the touch dispatcher should be processed before touches that are not registered?

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.