Web version full screen

Godot Version

4 Or New

Question

Title: Web version full screen
How to make it full screen? I read the “official document” and I don’t know what file it should be written in.
Is it possible to automatically go full screen when opening a web page?
I hope that when opening a webpage, it will automatically go to full screen, or click “Word” or “Image” to go to full screen.
In “Full Screen”, press “Word” or “Image” or “Middle Mouse Click twice” or “Keyboard ESC” to restore.
I hope to finish it as soon as possible within these three days,
I hope you can explain the process in detail, I’m not familiar with the program,
You can recommend “free website space” by the way,
But I can find it myself, it just takes a lot of time.

I believe, you can set it up on the website you want to publish your game on. For example, I used itch.io for my game. (if you want to see it by yourself, I could give you link for it)

Although, if you want to do this in your game, you might want to do this:

I have my settings scene, where I have check button button:
image

On my setting node I have script, which checks if this button turn on, game goes fullscreen
image

extends Control

func _on_check_button_toggled(button_pressed):
	if button_pressed == true:
		DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
	else:
		DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)

If you want to connect function _on_button_toggled, you have to click on your button
image
Then click on node
image
And connect it to script
image

1 Like

Thank you so much for being so kind that totally exceeded my expectations and thank you for teaching me to “use the toggle button”.
The sad part is that I wanted to put it on “my own website”.