Setting position to specific place on-screen

Get help using Construct 2

Post » Fri Dec 14, 2012 6:28 pm

Yeah you could use CanvasToLayer. If your canvas size is 640x480 and you want to spawn an object in the middle at 320,240 then you need to convert that canvas position to a layer position. So the position on layer 0 would be:

CanvasToLayerX(0, 320, 240), CanvasToLayerY(0, 320, 240)

or in general:

CanvasToLayerX(0, WindowWidth/2, WindowHeight/2),
CanvasToLayerY(0, WindowWidth/2, WindowHeight/2)
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Fri Dec 14, 2012 7:40 pm

@ramones - great, thanks!
B
27
S
8
G
5
Posts: 429
Reputation: 6,902

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 0 guests