Finding the Edge of the Display

This forum is currently in read-only mode.
From the Asset Store
Animated Counter
$3.60 USD
10% off
Make a displayed number gradually increase or decrease, making an impression of a real-time counting.
  • I'm updating my UI to work with multiple different resolutions, and would like to automate the process of UI positioning as much as possible - such as setting a timer to display at the top right of the screen , X-100, Y-50 - so that no matter what resolution the game is played at, the UI always draws in the correct places.

    Does anyone know what the commands are to find these screen edges?

  • You want to use windowwidth-100 and windowheight-50

  • Thanks <img src="smileys/smiley4.gif" border="0" align="middle" />

  • Damn, "windowwidth is not a recognized expression"...

    Any ideas?

    Also, even if it did work, I think that would only allow me to position something at the right of the screen (windowwidth-100) and not at the left. Unless setting something to windowwidth-windowwidth+100 would work?

  • I thought it was DisplayWidth and DisplayHeight

  • You must first add "window" object.then you must use this:

    Window.Width

    and

    Window.Height

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I can't provide examples, because I'm not at home (so please excuse, if the names may not be 100% correct), but...

    1) Display width and height describe the size of the visible area of the game's screen

    2) Window.Width and .Height describe the total size of the window used to display the game (meaning: including the caption bar/borders)

    3) Window.ClientWidth and .ClientHeight describe the size of the area, where the game is displayed, without caption bar/borders

    Try making your UI non-scrollable/non-zoomable and use [0, 0] to [DisplayWidth, DisplayHeight] for positioning.

  • Thanks for all the clarification, guys <img src="smileys/smiley1.gif" border="0" align="middle" />

    Hopefully I'll find time over the weekend to get this working! I'll update this thread if it does, just in case anyone from the future is searching the forums with a similar question.

    Assuming they survive the end of the world next month, that is <img src="smileys/smiley8.gif" border="0" align="middle" />

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