How do I get the Layout Scale ?

Get help using Construct 2

Post » Tue Nov 19, 2013 9:22 pm

@Tobye

Thanks again

Just to make sure, all the expressions for Viewport are the following:
ViewportBottom(layer)
ViewportLeft(layer)
ViewportRight(layer)
ViewportTop(layer)


When I have time, I will make a tutorial because this is a very important procedure if you want to develop games on different devices/platforms
B
49
S
15
G
6
Posts: 535
Reputation: 7,197

Post » Wed Nov 20, 2013 8:14 am

Letterbox Scale is a dead end after all because of 2 issues:
1) I can't get the correct WindowWidth and WindowHeight (it takes the WindowWidth and WindowHeight of the game, not of the Browser Tab)
2) Scale returns to 1 after changing Canvas Size, also bad alignment ( this bug )

Still, the Scale Inner seems to do the job. Also for the controls the Browser.DevicePixelRatio will come in handy (bigger density -> bigger touch buttons)
B
49
S
15
G
6
Posts: 535
Reputation: 7,197

Post » Thu Nov 21, 2013 6:43 pm

Wow ... The solution was painfully simple

After lots of attempts I realized that the solution was very simple:
Make a square-ish Window Size and use the Scale Outer
The game will have the same scale/size regardless the orientation of the device.
B
49
S
15
G
6
Posts: 535
Reputation: 7,197

Previous

Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 17 guests