browser resize / orientationchange event?

Get help using Construct 2

Post » Tue Aug 28, 2012 10:05 am

Does anyone know where the events for orientationchange and resizing are? Looked under System and Browser objects.

Please dont tell me one has to poll the screen width/height every tick - in an event driven framework this would be crazy....nutmix2012-08-28 10:06:13
B
15
S
5
G
2
Posts: 357
Reputation: 3,691

Post » Wed Sep 05, 2012 3:23 am

I've been looking for the same thing. I thought I saw it one time, so in my planning I didn't look again, but I guess it doesn't exist :(

The polling of current screen width to a global variable that stored the last screen size is working for me accept for when the window is maximized, then it freaks out :(

of course, it could just be that my brain has shut down for the day and I'm missing something. I'll give it another go tomorrow.

I would like to say though, that it's kind of silly that an engine that is (currently) purely html5/javascript/web-based doesn't have an "on resize" event. Maybe not enough people care? Though I'd like to know how they manage a full screen HUD (or any HUD) if the window size is smaller than the canvas? Maybe they just keep it in the 800 x 600 range and forget about it? Maybe I'm just missing something?
B
16
S
1
G
3
Posts: 43
Reputation: 2,597

Post » Wed Sep 05, 2012 9:52 am

Is System -> Set Canvas Size what you were looking for?

For orientation, you can try and use the Touch's Gamma values to detect what orientation you're on, and then use the rotation of layers to compensate. If you're confused, go into System's "Compare two values" to access an object's variable.brockatkinson2012-09-05 10:42:23
B
14
S
1
G
2
Posts: 85
Reputation: 2,810

Post » Wed Sep 05, 2012 12:11 pm

I guess 'on size' is missing from the Browser object, will try to add for next build.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,574

Post » Wed Sep 05, 2012 10:38 pm

Thanks Ashley!
B
15
S
5
G
2
Posts: 357
Reputation: 3,691

Post » Wed Sep 05, 2012 10:49 pm

Brockatkinson, what is the canvas, and how does it relate to the projects "Window size"? Canvas is not in the manual, unfortunately. I have seen viewport mentioned a few times also, but cant find any reference to it. Are they different?

Any tips appreciated!
B
15
S
5
G
2
Posts: 357
Reputation: 3,691


Return to How do I....?

Who is online

Users browsing this forum: heliogame, WhosWho and 23 guests