How do I can get the size of browser window?

Get help using Construct 2

Post » Wed Apr 30, 2014 7:43 pm

Hi, How I can get the size of browser window.
Not the size of the screen.
For example the size of the screen can be 1024*728. But user can resize his browser on 321*500.
Where I can get this numbers?
B
3
Posts: 8
Reputation: 191

Post » Thu May 01, 2014 1:08 am

I would also like to know. This will be useful for dynamic canvas resizing, just like on the dynamic websites.
Last edited by eli0s on Fri May 02, 2014 10:51 pm, edited 1 time in total.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Fri May 02, 2014 9:46 pm

so... Is it any way to get the size of browser window?
B
3
Posts: 8
Reputation: 191

Post » Fri May 02, 2014 10:54 pm

I tend to think that we can't, but until someone knowledgefull confirm/disprove it, we'll won't know for sure.
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Fri May 02, 2014 11:13 pm

@ggman @eli0s

WindowWidth and WindowHeight from System expressions is what you need ;)
B
49
S
15
G
6
Posts: 534
Reputation: 7,195

Post » Sat May 03, 2014 7:58 am

@TGeorgeMihai

Thank you. For some reason the WindowWidth/WindowHeight were lodged in my mind as being equivalent to screen size. They indeed return the browser's active area dimensions.

It turns out that It's the lack off set WindowWidth/WindowHeight (or set aspect ratio) expressions that bothers me. The set canvas size doesn't work as I expected, I can't find a way to dynamically position and scale objects in relation to the browser's dimensions. The "Fullscreen in browser" and "Anchor" behavior doesn't seem to help either...

Oh well... :)
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, marc254, tarek2 and 19 guests