Incorrect Touch X, Y values on Android

Get help using Construct 2

Post » Fri Jul 05, 2013 12:55 pm

@mchulet

A good workaround is setup a global variable to save the last Touch position, like one variable for touch.x and another to touch.y

Then, check the variable, and not the touch object.

This is the way I'm doing for my game.

http://goo.gl/1a3Jt

On the game, open the chrome console, click inside the game and press D, it will show you the debug, where you can see the lastest touch position.
ImageImageImageImageImageImage
Image
B
98
S
22
G
16
Posts: 1,338
Reputation: 21,202

Post » Fri Jul 05, 2013 1:32 pm

@LittleStain Thanks, I'll try your solution.

@DrGreenThumbCAN these variable would need to be updated from value of Touch X, Y right ? if Touch does not carry proper values then won't these variable be reporting wrong values ?

-Thanks
B
10
S
3
Posts: 74
Reputation: 1,600

Post » Sat Jul 06, 2013 4:37 am

[QUOTE=mchulet] @DrGreenThumbCAN these variable would need to be updated from value of Touch X, Y right ? if Touch does not carry proper values then won't these variable be reporting wrong values ?

-Thanks[/QUOTE]
@mchulet
Not sure what you mean
but here's capxfor what I was meaning showing touch gives cor values
mind you im using laptop dont have touch device but mouse is enabled as touch in properties by default (see manual)

sorry maybe I don't understand your problem as I don't have touch device

Set your x and y values to the sprite not the touch each tick (or your time interval) set sprite x to touch x and sprite y to touch y
then when touch LEAVES sprite STAYS so values are staying as sprite is staying
just make a small sprite and ot visibleDrGreenThumbCAN2013-07-06 04:37:47
B
40
S
12
G
6
Posts: 136
Reputation: 6,347

Post » Wed Jul 10, 2013 5:55 am

Thanks @DrGreenThumbCAN

I think as a system its working fine, something that I have done that's making it mess up. Let me investigate.
B
10
S
3
Posts: 74
Reputation: 1,600

Previous

Return to How do I....?

Who is online

Users browsing this forum: Tuiii and 7 guests