Godot_v4.3-dev6
Question:
How to work it from this demo: Tristram by bippinbits
if click enter fullscreen button from my smartphone, game is start full-screen and rotate from landscape mode, and locked auto-rotate function from Android.
my javascript:
var myScreenOrientation = window.screen.orientation;
myScreenOrientation.lock(“landscape”);
my godot settings:
[sensor landscape or / landscape mode] from display/window/handheld/orientation
and use this code from gdscript:
if(DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_WINDOWED):
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
DisplayServer.screen_set_orientation(DisplayServer.SCREEN_SENSOR_LANDSCAPE)
not working…
How initiate rotate mobile screen orientation and locked from? [javascript/gdscript]
i’m using from javascript:
…
document.body.style.transform = ‘rotate(90deg)’;
…
I’m having a lot of problems detecting mouse clicks on the screen, this method doesn’t work
please help me, how initiate rotate screen from portait to landscape mode the use godot engine and html/javascript?
my webversion demo-project this (127 mb.):
https://nimovcode.ru/archive_demoC/NimovTestWEB.html
click INFO from up-right side screen and go to full screen mode.
Project setting → Display → Window → Handheld → Orientation
hi that won’t work because project settings are read once when the game starts and won’t update to reflect changes in it on runtime
you could read this information
Landscape
it’s default godot project settings, i’am already tested all the options and tested all gdscript variant’s not working…
I need to rotate the Web version of the application from the portrait position in which all people standardly hold their smartphone to the landscape picture position, so that the person begins to turn the smartphone over and play without forcing him to use the function (auto-rotate android) as I did now.
I know that you need to use javascript, and I attached an example of Tristram in which this function works correctly, if you press RUN GAME on a smartphone, the window opens and rotates as needed and forces the player to rotate the smartphone.
I did how to open it to full screen right away, it works easily, but the landscape function works in the engine only for .apk and .exe, but not for the web version of the project.
sorry, I don’t speak English , only google translate…
progressive_web_app/orientation
all settings for: progressive_web_app are also not suitable, these export settings only work for launching from a PC.
In my case, I need to run any godot project in google chrome on a smartphone with the android operating system.
Go to the site and click the start button, immediately rotate the browser window and enter full screen, immediately after clicking, and then the player himself turns the phone in his hands.
Now the option works for me is when I either rotate the entire screen using the Android function or click the screen rotation button in the google chrome browser that blinks at the bottom right
in this example everything works correctly for a smartphone: Tristram by bippinbits
ok…im going to review it.