How do I find the maximum Y of the screen?

0 favourites
  • 5 posts
From the Asset Store
Use this game pack to create your own game, modify the existing game or simply take a look and see how it was made.
  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • System variable viewporttop or bottom of left or right as I recall...

  • Ahh well I though I tried that..

    Thank you remy-jay

  • 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:

    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
    [/code:1x97qc0t]
    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.
  • 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)