Passing touch events between scenes

Passing touch events between scenes
0.0 0


Hi everybody,

In my current project I need to pass CCTouch object from one CCScene to another. What I want to achieve is that:

  1. SceneA: User begin touch, which starts transition
  2. Transition between SceneA and SceneB
  3. SceneB: If the user didn’t released his finger, he can continue using the touch.

I don’t know how clear is that, quite difficult to explain :confused:

I had a solution where I was keeping current touches in SceneA and injecting them to SceneB by calling ccTouchBegan. This worked fine until I added a transition between the scenes. It seems that during the transition none of the scenes receive touch events (??). This means if the user release his finger during the transition I inject a non-existing touch to SceneB, obvious fail :frowning:

Any other idea about how to cleanly implement that?

Currently I’m trying to create a global touch handler that keep all the active touch events. So when SceneB starts and can use it to retrieve the current touches and inject them.