swipe
amaso83

I am doing a mobile game, and I want to use the new swipe commands from wade 1.2

 

I can do

 

object.onSwipeRight = function()

 

this works. But I want to detect swipe right anywhere, not only when it is on object.

 

I think maybe I can use a transparent object in background to capture onSwipeRight event, but is this a good (best) idea or do you know a better approach?

All 3 Comments
Gio

Hi

 

You can do that simply by adding a function to your main App function, named with the same name as the event:

App = function(){    this.init = function()    {        ....    };    this.onSwipeRight = function()    {        ....    };};
amaso83

Yes, it worked! Thank you Gio.

 

But I have a different problem too: if I do swipe in chrome on my touchscreen laptop, it navigates back to a previous page in the history (internet explorer and firefox work). I think chrome recognizes this gesture to navigate backwords. Can I stop it?

Gio

True, I've just verified it. It looks to be a bug in the latest Chrome. However there is a workaround that we can use, and it'll be released in the next release of WADE.

 

Thanks for reporting the problem.

Post a reply
Add Attachment
Submit Reply
Login to Reply