question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Full screen in Unity 2020?

See original GitHub issue

<div class="fullscreen" onclick="gameInstance.SetFullscreen(1)"></div Is not appears on Unity 2020 Index.html.

Is there other solution to enable Full screen support for Unity 2020?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
NoamSapircommented, Oct 2, 2020

in Unity2020 WebGL Template you can find the fullscreen code fullscreenButton.onclick = () => { unityInstance.SetFullscreen(1); };

you can try to change this to fullscreenButton.onclick = () => { document.makeFullscreen('unity-container'); };

Its working, but the full screen is not a true full screen:

Untitled

0reactions
113kangkangcommented, Jun 16, 2023

I found some success getting the fullscreen to scale properly when I manually adjusted the width and height properties of the surrounding div and canvas elements: <div style="width: 1001px; height: 630px; border:0; margin:0; background-color: rgb(109,25,13);">

<div id="unity-container">
  <canvas id="unity-canvas" width =  "1001" height= "580"></canvas>
  <div id="unity-loading-bar">
    <div id="unity-logo"></div>
    <div id="unity-progress-bar-empty">
      <div id="unity-progress-bar-full"></div>
    </div>
  </div>
 </div>
</div>

EDIT: This caused problems for me when users zoom in or out of the webpage, so it's not a permanent solution.
``` } else {
    // Desktop style: Render the game canvas in a window that can be maximized to fullscreen:

   // canvas.style.width = "960px";
    //canvas.style.height = "600px";
  }

deactivate This

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I make my game fullscreen - Questions & Answers
To set a standalone player to be full screen, go to Edit>Project Settings>Player and under the Resolution and Presentation heading, ...
Read more >
How can I make full screen in unity editor's game screen?
Go to "Main Camera" resize the camera view (the white rectangle in image) -> make sure your Camera Preview contain all of your...
Read more >
Is there a keyboard shortcut to maximize the Game window ...
1. Go to Game tab and toggle Maximize On Play. · 1. On Mac is Shift + Ctrl + Space · 1. @[Ethan...
Read more >
Manual: Windows Player settings
Fullscreen Window, Set your app window to the full-screen native display resolution, covering the whole screen. This mode is also known as borderless...
Read more >
Standalone Player settings
Choose the full-screen mode. This defines the default window mode at startup. Fullscreen Window, Set your app window to the full-screen native resolution...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found