Project setting Window Size system expression

Discussion and feedback on Construct 2

Post » Mon May 14, 2012 6:47 am

Is there a system expression (or alternate way) to get the Window Size values from the Project setting section of the Properties Bar? Right now I'm finding that I am hard coding those numbers into my formulas for things like HUDs, and it'd be nice to have them dynamic in case I want to change the system setting in the future.

(PS, took me forever to realize that the system expression WindowWidth and WindowHeight weren't referring to the values in the project setting!)
B
51
S
13
G
8
Posts: 194
Reputation: 7,311

Post » Mon May 14, 2012 12:14 pm

Hmmm. They do for me.

EDIt: This project just uses WindowWidth and WindowHeight to position the ball sprite. When you run this project and left click, does the ball move from center to each corner of the window and then back to the center? If you change the window dimensions and run again does it still work for you? If it doesn't work, something strange is going on...

WindowSize.capx
kittiewan2012-05-14 12:39:53
B
29
S
11
G
12
Posts: 281
Reputation: 11,888

Post » Mon May 14, 2012 1:05 pm

Also check out the anchor behaviour and the tutorial on supporting multiple screen sizes.jbadams2012-05-14 13:06:13
B
24
S
5
G
2
Posts: 104
Reputation: 3,136

Post » Mon May 14, 2012 1:09 pm

WindowWidth and WindowHeight do refer to the project setting. You should get out of the habit of relying on fixed window sizes though - see supporting multiple screen sizes.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Mon May 14, 2012 5:07 pm

Ahh, I see where I was confused. Thanks all for the quick response!
B
51
S
13
G
8
Posts: 194
Reputation: 7,311


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 16 guests