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 do you resize the canvas using the new loading scheme [solved]

Discussion in '5.6 Beta' started by monark, Mar 28, 2017.

  1. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    The new loading scheme doesn't use the canvas element in the index.html.
    I used to be able to get the canvas element by id and then resize it when the containing window was resized.

    Now with the new loading scheme I can't work out how to resize the Unity content to always fill the window it's in.

    I can change the gameContainer to be 100% but that doesn't seem to internally change the Screen.width and Screen.height that is used by the Unity engine.

    So if you want the Unity canvas to always fill the browser window how do you now do that?
     
  2. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Of course as soon as I post this I think to look in UnityLoader and find the canvas element in there with id set to #canvas
     
  3. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    1,070
  4. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    Yes I saw that thread, it didn't seem to discuss anything other than fixed size embedding but maybe I missed it
    I have something that works now. Thanks.