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.

Author
Message
Deion
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United States
Posted: 20th Aug 2011 00:59
was looking if there was an api to detect swipes and panning for ios, however looking through the reference commands, i didn't see it. would it be best to just use teir 2? and use the static lib with obj-c? while this is ok, it kind of defeats the whole write it once concept since there really isnt swipes in windows or mac, just ios.

Cheers,
Deion G.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 20th Aug 2011 01:05
There is technically enough information in the GetRawTouchCurrentX() and others to detect a swipe, although I'll admit there could be an easier, more automated, way. Maybe in the future.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 20th Aug 2011 09:14
Maybe for now, someone will develop a set of simple functions using GetRawTouch to return human readable swipe movements
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 20th Aug 2011 13:58 Edited at: 20th Aug 2011 14:00
You don't even need the raw commands.

The GetPointerClick() And GetPointerReleazsed() commands should be used. Get the position of the cursor when GetPointerClick() is true, then get the position when GetPointerReleazsed() is true. Subtract one set of coord from another to get a distance vector, then put them into ATanFull to get a swipe direction.

THats what I do in the game i'm creating to open/close the pause menu. (Like the notification window on Android) and to close the game. (Like closing apps on WebOS)

I'll post an example when I'm on my other laptop...

My signature is NOT a moderator plaything! Stop changing it!
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 20th Aug 2011 14:16 Edited at: 20th Aug 2011 14:17


Here you go, my entire swipe code.

Make the variables global!

My signature is NOT a moderator plaything! Stop changing it!
Zubby1970
AGK Backer
15
Years of Service
User Offline
Joined: 22nd May 2008
Playing: AGK Studio Always
Posted: 20th Aug 2011 14:32
Mobbius you would also need to get how fast this swipe happened so we know how fast to display a swipped object. you could do this by some kind of timer that resets on the first click. count up until release and then calculate the speed vie the distance and time.

just a thought.

There can only be one
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 20th Aug 2011 18:42
I suppose you could, but I'm not doing that. Cant be bothered! lol

Didn't think of it to be honest! lol

My signature is NOT a moderator plaything! Stop changing it!

Login to post a reply

Server time is: 2024-03-29 09:30:33
Your offset time is: 2024-03-29 09:30:33