Current Position in the WindowView

Get help using Construct 2

Post » Fri May 10, 2013 8:30 pm

Let say I have a 1000 x 1000 Layout Size, but my Window Size is only say 250 x 250. Is there a way to get the current CENTER of the Window View?

No matter what I try it measures the X/Y event from the top left 0,0 of the layout, I want it to get from the current Window view, so if I have moved my Hero down 50 pixels my window Center would be somewhere in the 175.

Thanks
B
21
S
7
G
1
Posts: 128
Reputation: 3,076

Post » Fri May 10, 2013 8:35 pm

Standard algorithm:

ViewportLeft+(ViewportRight-ViewportLeft)/2
B
39
S
11
G
5
Posts: 132
Reputation: 8,228

Post » Fri May 10, 2013 8:57 pm


thank you So that might be the ticket, BUT what is THIS?

Viewportleft(THIS)+(Viewportright(THIS)-Viewportleft(THIS))/2

in the editor it says layer, does it mean a Layer I built like HUD? if so that is not working like I expect.
B
21
S
7
G
1
Posts: 128
Reputation: 3,076

Post » Fri May 10, 2013 9:02 pm

THIS means the name of the viewport.
ImageImageImageImageImageImage
B
92
S
19
G
12
Posts: 1,192
Reputation: 18,276

Post » Fri May 10, 2013 9:16 pm

(This), actually means the number of the layer your getting the coordinate off...
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260


Return to How do I....?

Who is online

Users browsing this forum: Braus, supreme676 and 7 guests