Finding the Edge of the Display

For questions about using Classic.

Post » Tue Nov 20, 2012 7:24 pm

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?
B
15
S
7
G
7
Posts: 250
Reputation: 5,298

Post » Tue Nov 20, 2012 7:31 pm

You want to use windowwidth-100 and windowheight-50
B
50
S
21
G
8
Posts: 844
Reputation: 10,299

Post » Tue Nov 20, 2012 7:59 pm

Thanks
B
15
S
7
G
7
Posts: 250
Reputation: 5,298

Post » Thu Nov 22, 2012 9:40 am

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?
B
15
S
7
G
7
Posts: 250
Reputation: 5,298

Post » Thu Nov 22, 2012 4:57 pm

I thought it was DisplayWidth and DisplayHeight
B
7
S
2
Posts: 123
Reputation: 1,061

Post » Fri Nov 23, 2012 3:16 pm

You must first add "window" object.then you must use this:
Window.Width
and
Window.Height
B
14
S
4
G
2
Posts: 91
Reputation: 2,390

Post » Fri Nov 23, 2012 5:47 pm

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.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Fri Nov 23, 2012 9:15 pm

Thanks for all the clarification, guys

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
B
15
S
7
G
7
Posts: 250
Reputation: 5,298


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests