Box position problem

Get help using Construct 2

Post » Mon Sep 26, 2016 11:37 am

I have a problem with calculating sprite position.
I use "Fullscrean in browser"="Scale outer"
In hud layout (parallax = 0,0) I have object and it should fill all the screen but not more, so it must start in left-top corner and end exactly in right-bottom corner.
But I dont knew how to do this with "Scale outer" and parallax = 0,0

https://www.dropbox.com/s/f1z4qwf13aej2a1/test.capx?dl=0
B
22
S
3
Posts: 74
Reputation: 1,515

Post » Mon Sep 26, 2016 12:00 pm

hobibit wrote: so it must start in left-top corner ...

Set position to ViewportLeft(layer);ViewportTop(leyer) ?
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Mon Sep 26, 2016 12:07 pm

That work perfectly, thanks!

I was trying something like:
(-WindowWidth+OriginalWindowWidth*WindowHeight/OriginalWindowHeight)/2
(-WindowWidth+OriginalWindowWidth)/2
(-WindowWidth+OriginalWindowWidth)/(2*WindowHeight/OriginalWindowHeight)
B
22
S
3
Posts: 74
Reputation: 1,515


Return to How do I....?

Who is online

Users browsing this forum: Brandons404, dop2000 and 30 guests