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 / iOS AGK Player and touch co-ordinates bug

Author
Message
APEXnow
Retired Moderator
20
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 19th Nov 2016 18:27
Hi guys,

I've discovered that when using the GetRawTouchCurrentX and GetRawTouchCurrentY commands on the iOS AppGameKit player v2.0.21, these commands appear to return zero co-ordinates no matter where I touch on the screen. The same test routine works just fine running under the Android AppGameKit player. Has this issue been resolved yet or should I be using an alternative method for obtaining touch co-ordinates?

Thanks.

Paul.
APEXnow
Retired Moderator
20
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 16th Jan 2017 19:55
I'm posting again, because this issue still exists. Even with the new Jan 8th 2017 update for iOS, the AppGameKit Player is still failing to register the co-ordinates for the input commands. The following code exhibits this issue when you run the function on iOS AppGameKit Player, but works perfectly under Android. I don't know whether this is an issue for other platforms, but can it be looked into?



Thanks guys.

Paul.
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 18th Jan 2017 04:13
The problem stems from this line in your code:



You are performing a modulus operand on the actual touch ID that is returned from GetRawFirstTouchEvent(1). This messes up all subsequent calls where you are checking against a specific ID but 'index' is assigned to whatever the remainder of touch ID / 20 is.

On iOS, the touch IDs are random numbers that can be as large as an integer supports. On Android they are generally 1, 2, 3, 4 etc. So in your code, the first iOS touch ID might be: 132207760 but you assign index to (132207760 % 20) which gives it a value of 0 (or some other low number). When you then call GetRawTouchCurrentX(index) you are trying to get the current X value of a touch ID that does not exist, due to your mod() operand on the index value. On Android it is only coincidental that this works as expected due to the touches being in chronological order from 1, and mod(1, 20) = 1 so it is still the same index.

P.S., General Tier 1 questions like this have more visibility if you post to the General AppGameKit Chat section, not many people lurk these other boards.
APEXnow
Retired Moderator
20
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 12th Feb 2017 12:56
Hi xCept,

I was completely oblivious to the concept that an iOS device returns a different ID for the GetRawFirstTouchEvent and GetRawNextTouchEvent functions. I modified my input handler and it works great now. So thanks for pointing this out to me.

Paul.

Login to post a reply

Server time is: 2024-03-28 18:48:48
Your offset time is: 2024-03-28 18:48:48