How do I make a control stick spawn on touch with HUD?

Just started using Construct 2? Post your questions here

Post » Thu May 07, 2015 4:39 am

So I've already got spawning a control stick to spawn wherever someone touches the screen, but when I put the control stick on a layer that has a parallax of 0,0. It spawns way off. The control stick needs to be on a HUD layer so it doesn't go off screen (obviously).

Why does this happen? I mean what's the problem when I put it on a HUD layer?

Here's the CAPX to show the problem: https://www.dropbox.com/s/tuubc69cpny20 ... .capx?dl=0
Risk Rocket now available on Google Play
Image
B
36
S
15
G
6
Posts: 337
Reputation: 6,300

Post » Thu May 07, 2015 11:24 am

https://dl.dropboxusercontent.com/u/485 ... layer.capx

The coordinates touch.x,touch.y are the project coordinates.
Luckily the touch object has the possibility to add a layer number behind the x and y
so touch.x(2) is the position of touch on layer 2 (your hud)
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri May 08, 2015 5:12 am

Thank you Stain! I definitely learned something to help me with future projects.
Risk Rocket now available on Google Play
Image
B
36
S
15
G
6
Posts: 337
Reputation: 6,300


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest