Search Unity

  1. How has 2019.2 and the beta been for you so far? Give us feedback in this thread.
    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:
    476
    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:
    476
  3. swogdog

    swogdog

    Joined:
    Jan 7, 2013
    Posts:
    13
    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:
    476
    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:
    13
    Perfect, got it working! Thanks.