How do I find the maximum Y of the screen?

Get help using Construct 2

Post » Mon May 25, 2015 11:20 pm

Hi,

I'm making a mobile game and I'm using "Scale Inner" scaling mode for it.
The problem is I can't put everything in place because I don't know what the maximum Y shown is.. (I'm using a tall layout) I've an action to scroll Y to 0 on start of layout.
So I want to get the Y point for every device but I can't get it.

EDIT: I've tried WindowHeight, Browser.ScreenHeight .. They're still the same whenever the screen scales..

Thanks
B
26
S
9
G
2
Posts: 234
Reputation: 3,199

Post » Tue May 26, 2015 1:38 am

System variable viewporttop or bottom of left or right as I recall...
B
72
S
14
G
1
Posts: 151
Reputation: 4,999

Post » Tue May 26, 2015 10:38 am

Ahh well I though I tried that..
Thank you @remy-jay
B
26
S
9
G
2
Posts: 234
Reputation: 3,199

Post » Tue May 26, 2015 8:39 pm

We are using "Scale outer" for "Fullscreen in browser" mode, which makes enormous differences in where the "edges" of the screen are relative to the internal coordinate system in Construct.

I have found this to work fairly reliably across different modes:

Code: Select all
CanvasToLayerY("backdrop",0,0)  // top of screen
CanvasToLayerY("backdrop", WindowWidth, WindowHeight)  // bottom of screen
CanvasToLayerX("backdrop",WindowWidth, WindowHeight)  // right side of screen
CanvasToLayerX("backdrop",0,0)  // left side of screen

I use these to make my user interfaces in Construct fully dynamic (i.e. if the user resizes the window, Construct will automatically resize everything inside).

Note: "backdrop" is my primary display layer's name.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,416
Reputation: 4,826

Post » Wed May 27, 2015 12:35 pm

@gumshoe2029 That seems like a legit way..
I usually go for Scale outer mode but for the kind of game I'm making (A SHMUP for mobiles) I gave a lot of thoughts (And tests) and I chose Scale inner Fullscreen mode.

Anyways I'll surely try that way when using Scale outer fullscreen mode, thanks!
B
26
S
9
G
2
Posts: 234
Reputation: 3,199


Return to How do I....?

Who is online

Users browsing this forum: amazingdream and 25 guests