Hey im looking for some kind of documentation or any source to learn how fullscrenn works on mobile devices in web games.
Im making game for web and im trying to add fullscreen mode, It works fine but resoultion is very bad :/ and icant find any informations about this.

  • Megalomaniak replied to this.
  • You might have to enable HiDPI in the project settings. Also note that Apple devices and some Android devices do not report their actual display resolution. They report a virtual resolution in the browser to better format websites. For example, the screen could be 4K but reports to the browser as 1080p for compatibility reasons. This is normal. I recall getting this working on my custom WebGL project, but I don't remember how I did it. You can do it with Javascript and CSS code, if the HiDPI switch in Godot doesn't work.

    Mydel Im making game for web and im trying to add fullscreen mode, It works fine but resoultion is very bad

    Care to share some more details about your project settings?

    You might have to enable HiDPI in the project settings. Also note that Apple devices and some Android devices do not report their actual display resolution. They report a virtual resolution in the browser to better format websites. For example, the screen could be 4K but reports to the browser as 1080p for compatibility reasons. This is normal. I recall getting this working on my custom WebGL project, but I don't remember how I did it. You can do it with Javascript and CSS code, if the HiDPI switch in Godot doesn't work.

      cybereality

      Accualy I'm changing screen_stretch based on Javascript interface "window.innerHeight/innerWidth" but in fullscreen mode everything was blurred. After debugging my game window in html iframe component was 784x1364 with 256ppi (on mobile android), it is not changeing in fullscreen but the effect keeps the same. I was trying to resize it mannualy but it didint work.

      Thanks accualy it works perfectly with everything i done before in project. Thank you so much i ahhd no idea that something like this even exist in godot and spend a lot of time trying creating code with JavaScript.eval...

      Also, you should keep in mind that for web you likely do not want to render at native screen resolution. Some people may have 1440p or 4k monitors or phones, but not the latest graphics card / chip, and it will be very slow, even for a 2D game.

      If you are doing more of an intensive 3D game, you probably want to default to 720p, and then maybe have an options menu that allows 480p, 720p, and 1080p choices.