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 / Controls with Multi touch

Author
Message
Kozax
9
Years of Service
User Offline
Joined: 28th Jul 2015
Location: London, UK
Posted: 5th Sep 2015 22:05
Hello,

I have a box and I want to move it with touch and my screen's width is 360 so I did this:



This was working on my tablet but when I tried it on my iphone that has multitouch happened this:
If I was pressing on the right side and with another finger on left the box wouldn't change direction but still continue its way.
So I was wondering is there a way to bypass this like disabling multi touch or any other way that detects the last finger input?

Thanks
Crazy Programmer
AGK Developer
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Lost in AGK
Posted: 6th Sep 2015 01:24 Edited at: 6th Sep 2015 01:35
I set it up this way.



Edit: Sorry I Miss-read your question...
2ndEdit: I have checked the help docs and cant find anything that would disable a 2nd touch if PointerState()=1 Or even disabling the Pointer in general.

http://crazyprogrammerproductions.webs.com/
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 6th Sep 2015 14:54
Start by looking up GetRawTouchCount() in the help, and then check all of the associated commands that go with it

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Kozax
9
Years of Service
User Offline
Joined: 28th Jul 2015
Location: London, UK
Posted: 6th Sep 2015 15:12 Edited at: 6th Sep 2015 15:22
@Crazy Programmer Thank but I already tried that, anyone else that might know what to do?
Crazy Programmer
AGK Developer
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Lost in AGK
Posted: 6th Sep 2015 16:07
^ Thanks Batvink!

Kozax you should check out. http://www.appgamekit.com/documentation/Reference/Input-Raw/GetRawFirstTouchEvent.htm
Check out the examples provided....it is exactly what you need...

http://crazyprogrammerproductions.webs.com/
Kozax
9
Years of Service
User Offline
Joined: 28th Jul 2015
Location: London, UK
Posted: 6th Sep 2015 16:11 Edited at: 6th Sep 2015 16:12
Ok I will check it out!
Kozax
9
Years of Service
User Offline
Joined: 28th Jul 2015
Location: London, UK
Posted: 8th Sep 2015 14:07 Edited at: 8th Sep 2015 14:07
I understand the commands but I can't seem to get the logic I how to use these commands to fix my issue, can someone help?
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 19th Sep 2015 01:27 Edited at: 21st Sep 2015 23:20
Try this:

EDIT: found a better way to do this so updated the code


The issue with the multi-touch controls is figuring out what kind of touch event has happened. In this case I don't think tap, swipe or hold really work so it just registers that the screen is being touched.

I've then used two variables move_right and move_left that cancel each other out when the sprite movement is being calculated.

Hopefully it makes sense.

Invaders of the 29th Dimension - available now on Google Play
Find me on indieDB
Kozax
9
Years of Service
User Offline
Joined: 28th Jul 2015
Location: London, UK
Posted: 12th Oct 2015 00:56
Thank you 29, your solution worked!

Login to post a reply

Server time is: 2024-11-21 15:02:04
Your offset time is: 2024-11-21 15:02:04