Touch.X, Touch.Y

Get help using Construct 2

Post » Fri Oct 14, 2011 5:46 am

i am having some trouble converting this:

mouse -> on button release --> set angle toward (Mouse.X, Mouse.Y)

into a serviceable mobile touch element

touch -> on touch end (or any of the touch commands) --> set angle toward (Touch.X, Touch.Y)**

** when i run this on my mobile device the sprite would go off to the left at a 45 degree angle (r61) and goes straight up screen (r62) no matter where the touch occurs on the screen

any suggestions?? qwiktags2011-10-14 05:49:10
B
16
S
2
G
1
Posts: 43
Reputation: 1,473

Post » Fri Oct 14, 2011 12:59 pm

Hmm, might be a bug - I'll see if I can fix this for the next build.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Fri Oct 14, 2011 1:15 pm

Thanx
B
16
S
2
G
1
Posts: 43
Reputation: 1,473

Post » Sun Oct 16, 2011 4:57 am

@Ashley

i did a test to see if the values for Touch.X, Touch.Y are at least being registered

the set up:

global variable = someTouchedX
global variable = someTouchedY

touch -> on touch start --> someTouchedX (Touch.X)
                            someTouchedY (Touch.Y)
                            textX = someTouchedX
                            textY = someTouchedY
** the touch values from Touch.X and Touch.Y do register however the values do not translate (immediately)

what i've noticed is that the Touch.X and Touch.Y do not register until there is a second touch
(i.e. 1st touch sprite moves in this case upward toward the top of the screen a 2nd touch is entered and the Touch.x and Touch.Y coordinates register and the sprite moves according to -> set angle to (Touch.X, Touch.Y) )

+ not sure if this is a bug in r62 or a matter of "programming" qwiktags2011-10-16 06:50:50
B
16
S
2
G
1
Posts: 43
Reputation: 1,473


Return to How do I....?

Who is online

Users browsing this forum: Artpunk, gregorysforster, onzephyr and 1 guest