Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

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,078
  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.