browser resize / orientationchange event?

0 favourites
  • 6 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • 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....

  • 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?

  • 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.

  • I guess 'on size' is missing from the Browser object, will try to add for next build.

  • Thanks Ashley!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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!

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