Search Unity

[Solved] Full Size Canvas

Discussion in 'Unity 5 Pre-order Beta' started by Rob4507, Dec 27, 2014.

  1. Rob4507

    Rob4507

    Joined:
    Aug 29, 2007
    Posts:
    53
    Hi guys,

    I've been trying to figure out (with no luck) how to set up my webgl so that when the web page is run, the screen is maximized to the width and height of the web page. I don't want the unity canvas stretched, I want full 1:1 resolution of the browser window.

    Also, it needs to resize if the browser resizes at any time.

    I'm hoping someone has better knowledge of html (and the Unity exporter) than me because it looks like dark magic when I look at it.

    Thanks in advance.
     
  2. tomekkie2

    tomekkie2

    Joined:
    Jul 6, 2012
    Posts:
    737
    That's how i did that - if that is what you are after.
    http://virtualplayground.d2.pl/web/
    I put some functions to the javascript on the webpage and then the webgl player sends a message to that on Start.
    But I have just discovered these functions could be just embedded inside the webgl player and run from inside.
    It also handles the window resize events.
    I am just going to make a template for that.
     
  3. Rob4507

    Rob4507

    Joined:
    Aug 29, 2007
    Posts:
    53
    Nice. Thank you! That works great.
     
unityunity