HTML5 fullscreen fix! (:

This commit is contained in:
Harmony Honey 2021-10-02 17:27:48 -04:00
parent a0a541475d
commit bdca57735a

View file

@ -91,19 +91,29 @@ script/source = "extends Node2D
onready var fill = $Box/Fill
var is_selected = false
func _ready():
fill.visible = OS.window_fullscreen
func act():
var is_full = OS.window_fullscreen
OS.window_fullscreen = !is_full
Shared.set_window_scale()
$AudioStreamPlayer.play()
fill.visible = !is_full
if !is_full:
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
else:
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
func select():
is_selected = true
func deselect():
is_selected = false
# HTML5 fullscreen fix
func _input(event):
if is_selected and event.is_action_pressed(\"jump\"):
var is_full = OS.window_fullscreen
OS.window_fullscreen = !is_full
Shared.set_window_scale()
$AudioStreamPlayer.play()
fill.visible = !is_full
if !is_full:
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
else:
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
"
[sub_resource type="GDScript" id=6]