1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    30
    Vote Rating
    0
    exs is on a distinguished road

      0  

    Default launching scenes based on direction of touch (swipe)

    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!

  2. #2
    Sencha User arnebech's Avatar
    Join Date
    Jun 2010
    Posts
    498
    Vote Rating
    9
    arnebech will become famous soon enough

      0  

    Default


    Here is a gesture class from Sencha Touch 2 that detects horizontal swipes
    http://docs.sencha.com/touch/2-0/sou...orizontalSwipe
    That might give you some inspiration to get started.

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    30
    Vote Rating
    0
    exs is on a distinguished road

      0  

    Default


    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!

  4. #4
    Sencha User arnebech's Avatar
    Join Date
    Jun 2010
    Posts
    498
    Vote Rating
    9
    arnebech will become famous soon enough

      0  

    Default


    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.
    mySwipeScript.setAnimationController(controller);


    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.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar