How do I manipulate touch input?

Get help using Construct 2

Post » Fri May 09, 2014 2:08 am

Is there a way to transpose touch input?

If the left side is 0%, right side is 100%-
I would like to touch the middle and have it respond as if I touched it at 25%.
Touch the right side and I get 50%.
Touch the left side and I get 0%.

I need to transpose my Touch input X by 1/2.
Is this possible?
B
10
S
4
G
2
Posts: 133
Reputation: 2,667

Post » Fri May 09, 2014 5:22 am

Easiest would be to make a tiny invisible sprite, get the input coordinate/2 and set that as the sprites x,y. Then do a collision check to see what it overlaps.
For 1 axis you only halve the X or Y.
That would take 2 events (on touch) and (on overlap),and I cant think of a way to hack the touch input directly.
Check out our WIP:BroodImage
B
9
S
1
G
2
Posts: 57
Reputation: 1,443

Post » Sat May 10, 2014 8:10 pm

Interesting idea... similar to how I thought I might have to do it but I wasn't so sure about the collision thing.

Thanks I will be looking into this!
B
10
S
4
G
2
Posts: 133
Reputation: 2,667


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests