hide mouse on fullscreen! trying to fix player d-pad input

This commit is contained in:
Harmony Honey 2024-02-11 17:15:32 -05:00
parent 75460b0c6f
commit 2750ee62fe
3 changed files with 9 additions and 4 deletions

View file

@ -96,8 +96,8 @@ func _physics_process(delta):
# input
if !is_attract_mode:
btnx = btn.d("right") - btn.d("left")
btny = btn.d("down") - btn.d("up")
btnx = int(round(Input.get_axis("left", "right")))
btny = int(round(Input.get_axis("down", "up")))
btnp_jump = btn.p("jump")
btnd_jump = btn.d("jump")
btnp_pick = btn.p("action")

View file

@ -316,7 +316,7 @@ func load_options(path := options_path):
if dict.has("music"):
bus_volume[2] = int(dict["music"])
if dict.has("fullscreen"):
OS.window_fullscreen = bool(dict["fullscreen"])
set_fullscreen(bool(dict["fullscreen"]))
func delete_slot(_slot := save_slot):
var dir = Directory.new()
@ -500,3 +500,7 @@ func get_all_children(n, a := []):
for i in n.get_children():
a = get_all_children(i, a)
return a
func set_fullscreen(arg := false):
OS.window_fullscreen = arg
Input.mouse_mode = Input.MOUSE_MODE_HIDDEN if arg else Input.MOUSE_MODE_VISIBLE

View file

@ -16,7 +16,8 @@ func deselect():
func _input(event):
if is_selected and event.is_action_pressed("ui_yes"):
var is_full = OS.window_fullscreen
OS.window_fullscreen = !is_full
Shared.set_fullscreen(!is_full)
#OS.window_fullscreen = !is_full
Shared.set_window_scale()
Audio.play("menu_pause", 0.9, 1.1)
fill.visible = !is_full