Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to setup the webgl export for full browser window size?

Discussion in 'Unity 5 Pre-order Beta' started by tomekkie2, Dec 12, 2014.

  1. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    972
    How to setup the webgl export for full browser window size?
    Or just to get any form of a flexible layout in browser?
     
    Last edited: Dec 12, 2014
  2. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    972
  3. swogdog

    swogdog

    Joined:
    Jan 7, 2013
    Posts:
    14
    Hey! Thanks for this, exactly what I was looking for.

    It seems some of the structure has changed with the current WebGL build (using RC2). I updated it as best I could, but it doesn't go full window size until you resize the window a little, then it snaps. I was wondering if you're going to update this?

    You'd think this would just be an option in the build settings...
     
  4. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    972
    No.
    There is a js function handling the resize events on the template page.
    But you have also to run it once just after the webgl has loaded.
    So you have to invoke this function (I have named it "OnLoad" or something) with Application.ExternalCall from any Monobehaviour in the Start function.
     
  5. swogdog

    swogdog

    Joined:
    Jan 7, 2013
    Posts:
    14
    Perfect, got it working! Thanks.