Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGL fullscreen cannot work, unity 2022.3.20 LTS #138

Closed
zaichenhu opened this issue May 7, 2024 · 12 comments
Closed

WebGL fullscreen cannot work, unity 2022.3.20 LTS #138

zaichenhu opened this issue May 7, 2024 · 12 comments

Comments

@zaichenhu
Copy link

zaichenhu commented May 7, 2024

I noticed you have had some recent updates, and I'm not sure if one of the issues I previously raised (#134) has been addressed. There has been an ongoing problem in the 2022.3.x version where I couldn't input Chinese characters while in full-screen mode(Full-screen mode without the white bar at the top.)I have tested it in firefox, google chrome and edge on windows10

TestIME3

@kou-yeung
Copy link
Owner

release a new version for fullscreen.
release

you can call WebGLSupport.WebGLWindow.SwitchFullscreen() from your app to switch fullscreen.

@zaichenhu
Copy link
Author

zaichenhu commented May 14, 2024

release a new version for fullscreen. release

you can call WebGLSupport.WebGLWindow.SwitchFullscreen() from your app to switch fullscreen.

I encountered an issue where I don't know how to call this method when clicking on Unity's default template fullscreen button. However, calling 'switchfullscreen' within the game works fine.

Another issue is that I tried using Unity's minimal default template (which doesn't have a fullscreen button) and then calling this method within the game, which resulted in an error. It seems like this method must be called from within the default template?

屏幕截图 2024-05-14 112722

@kou-yeung kou-yeung added the verification scheduled 検証予定 label May 14, 2024
@kou-yeung
Copy link
Owner

on Unity's default template fullscreen button.
it was call "unityInstance.SetFullscreen(1);" to make fullscreen for canvas.

i tried eidt the index.html ( unity 2023.2.2f1 ) Line.106

unityInstance.SetFullscreen(1);
↓
document.makeFullscreen("unity-container");

the default fullscreen button is work.

@kou-yeung
Copy link
Owner

and i tried Unity's minimal default template.
in this time . WebGLSupport.WebGLWindow.SwitchFullscreen() is not work for this.

because minimal default template was like ↓

<body>
  <canvas />
</body>

document.makeFullscreen() is add a new div element to parentNode of canvas. ( in this case is the )
the element can not add to other element...

e.g. in Unity's default template

non fullscreen mode :

<body>
  <div id="unity-container" class="unity-desktop">
    <canvas id="unity-canvas" width=960 height=600 tabindex="-1"></canvas>
  </div>
</body>

when called WebGLSupport.WebGLWindow.SwitchFullscreen()

<body>
  <div>  // <-- add a new div element and make it to fullscreeen
    <div id="unity-container" class="unity-desktop">
      <canvas id="unity-canvas" width=960 height=600 tabindex="-1"></canvas>
    </div>
  </div>
</body>

@kou-yeung
Copy link
Owner

i think can check the canvas parentNode type and switch it...
but i need same time to test it..

@kou-yeung
Copy link
Owner

release a new version for minimal default template
https://github.com/kou-yeung/WebGLInput/releases/tag/1.3.5

@kou-yeung
Copy link
Owner

update README demo link use github io.
build with all Unity's WebGL Template. ^^

@kou-yeung
Copy link
Owner

i will try to overwrite the default fullscreen button after build.
#146

@kou-yeung
Copy link
Owner

@zaichenhu
Copy link
Author

zaichenhu commented May 16, 2024

release a new version~ https://github.com/kou-yeung/WebGLInput/releases/tag/1.3.6

I have tested it on Chrome, Firefox, Edge, and Safari, and now it can all be input correctly. This is great! Thank you very much.

I have a small suggestion, Could you please adjust the position of the suggestion box more reasonably? Sometimes it appears at the top of the screen, and other times it may cover the input box, especially when using Safari.

@kou-yeung
Copy link
Owner

I have a small suggestion, Could you please adjust the position of the suggestion box more reasonably? Sometimes it appears at the top of the screen, and other times it may cover the input box, especially when using Safari.

can i has a reproduction project. and create a new isuue to me.
because this was dependent with font size, element size and unity inputfiled rect..

@kou-yeung
Copy link
Owner

so, i will close this issue~
thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants