Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    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:
    545
    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:
    545
  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:
    545
    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.
     
unityunity