Page 1 of 1

Box position problem

PostPosted: Mon Sep 26, 2016 11:37 am
by hobibit
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

Re: Box position problem

PostPosted: Mon Sep 26, 2016 12:00 pm
by korbaach
hobibit wrote: so it must start in left-top corner ...

Set position to ViewportLeft(layer);ViewportTop(leyer) ?

Re: Box position problem

PostPosted: Mon Sep 26, 2016 12:07 pm
by hobibit
That work perfectly, thanks!

I was trying something like:
(-WindowWidth+OriginalWindowWidth*WindowHeight/OriginalWindowHeight)/2
(-WindowWidth+OriginalWindowWidth)/2
(-WindowWidth+OriginalWindowWidth)/(2*WindowHeight/OriginalWindowHeight)