launching scenes based on direction of touch (swipe)
I am trying to do the following:
user swipes touch area to the left = launches scene 1
user swipes touch area to the right = launches scene 3
Kinda like a carousel, I just need to register the direction of the swipes and launch the appropriate scenes.
Any help would be awesome!
Here is a gesture class from Sencha Touch 2 that detects horizontal swipes
That might give you some inspiration to get started.
That's great stuff. Thanks for the link. Do you have an example of how I can modify this script to tie it to a scene change? That's the part that I am having difficulty. any help is GREATLY appreciated!
I can give you a couple of high level pointers of one potential solution.
I'd write a swipe script and make it listen on the document for swipes. You can include this script by adding a script tag and referencing it in Animator in the properties side panel under Project -> Head HTML.
Then on your first scene, you can add a start action, in the start action you can connect the animation controller to your script. E.g.
then in your swipe script you'd store the reference to the animation controller, and you can call
animationController.goToSceneByID(); etc to control the animation.