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.

iOS and MacOS / Function for Swipe ?

Author
Message
joachim
10
Years of Service
User Offline
Joined: 21st Feb 2012
Location: Vancouver Canada
Posted: 20th Jan 2013 18:45
Hi All,

is there a way to use the iOS methods for a one finger swipe
directly from agk,
do we have a function which does it,
or has anybody written it already ?

Ios**************************************************************

- (void)oneFingerSwipeLeftUITapGestureRecognizer *)recognizer {
// Insert your own code to handle swipe left
}

- (void)oneFingerSwipeRightUITapGestureRecognizer *)recognizer {
// Insert your own code to handle swipe right
}
*****************************************************************

cheers
tornado
17
Years of Service
User Offline
Joined: 21st Jul 2005
Location:
Posted: 20th Jan 2013 20:58
Looks like last beta doesn't have such function.
However can be done with some code (tier2, improvements welcome):


Hodgey
12
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 21st Jan 2013 06:43
There's the GetRawTouchType() command. If it returns 3 then it has detected a 'drag'.

tornado
17
Years of Service
User Offline
Joined: 21st Jul 2005
Location:
Posted: 21st Jan 2013 08:15
Quote: "There's the GetRawTouchType() command. If it returns 3 then it has detected a 'drag'."

This value just tells that the finger was moved on the screen, no matter which direction and how far (1pt any direction at least to return "drag" value). I wouldn't consider this a one-finger-swipe gesture.

Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 21st Jan 2013 16:42
You can use the GetRawTouchFirstX/Y and GetRawTouchLastX/Y commands to get start and end points and then calculate the distance. If it isn't far enough for you to consider it a proper drag, then count it as simply a touch.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
tornado
17
Years of Service
User Offline
Joined: 21st Jul 2005
Location:
Posted: 21st Jan 2013 21:36
Ancient Lady, this is exactly what I've suggested in the code above.


Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 21st Jan 2013 21:53
Sorry, I didn't look at the code you posted again before I commented.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2022-09-25 22:09:43
Your offset time is: 2022-09-25 22:09:43