mirror of
https://github.com/HarmonyHoney/tiny_crate.git
synced 2026-07-18 00:47:03 +00:00
HTML5 fullscreen fix! (:
This commit is contained in:
parent
a0a541475d
commit
bdca57735a
1 changed files with 20 additions and 10 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue