Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Getting the player's swipe - working on PC but not on Android

Author
Message
Scifictus
9
Years of Service
User Offline
Joined: 7th Feb 2015
Location:
Posted: 26th Mar 2015 21:53
Hi All

Having some problems with my gesture input. I capture the getpointerx & y positions for a number of consecutive Sync()'s then interrogate these to determine if a swipe has been made and in what direction. This seems to work fine when testing on my PC using my mouse - it correctly picks up even the slightest of movements - I am happy that the maths/logic is correct. However when exporting APK to android it seems very sluggish by comparison, missing two or three swipes completely. The code is not very demanding and there is plenty processing headroom in each Sync() call.

Is there any difference I need to be aware of between the frequency/resolution of the getpointer commands on PC vs Android? Has anyone encountered similar problems? Would anyone like to share their gesture input code that works succssfully in both environments?

Thanks as always for any help.

Mike
Mike Archer
9
Years of Service
User Offline
Joined: 19th Feb 2015
Location: Wales
Posted: 27th Mar 2015 13:18
Remember on a PC GetPointerX/Y will return the current position of the mouse, whilst on a tablet they will return the position of the last touch event. If you want the same behaviour on both platforms, you should ignore any values returned from GetPointerX/Y unless GetPointerState() is True.
Scifictus
9
Years of Service
User Offline
Joined: 7th Feb 2015
Location:
Posted: 27th Mar 2015 13:21
Thanks Mike - I forgot about that and yes that was part of the problem! I also realise my code was unnesscarily complex....have fixed the above problem and simplified as well.

All working now - thanks for the help

Login to post a reply

Server time is: 2024-04-16 17:18:07
Your offset time is: 2024-04-16 17:18:07