How do I detect touch on the L/R part of the screen ?

Get help using Construct 2

Post » Sun Oct 02, 2016 8:18 am

How can I detect if the user touch on the left or right (blue or red in the image) part of the user screen ?
Image
(explicative image, I don't use these panels in the game)

I can't calculate it with layout touch coordinates because my layout is very big and the camera scroll with ScrollTo behavior, and I don't understand how to use Absolute touch coordinates.

Thanks.
Image
B
6
S
2
Posts: 42
Reputation: 538

Post » Sun Oct 02, 2016 8:33 am

You can use two invisible sprites, one left and one right. (In your example the left is the size of the blue square and the right is the size of the red square)
If the player touch the left then...
If the player touch the right then...
B
12
S
7
G
4
Posts: 114
Reputation: 3,067

Post » Sun Oct 02, 2016 8:52 am

The problem is that the camera scroll with the player so invisible sprites will be left in the same place that isn't in the user window.
Image
B
6
S
2
Posts: 42
Reputation: 538

Post » Sun Oct 02, 2016 8:54 am

You have to put the invisible sprites on a layer that doesn't scroll.
B
12
S
7
G
4
Posts: 114
Reputation: 3,067

Post » Sun Oct 02, 2016 10:43 am

Thanks, it works.
Image
B
6
S
2
Posts: 42
Reputation: 538


Return to How do I....?

Who is online

Users browsing this forum: lolsuperscratch, RobertMKD, tarek2 and 9 guests