gd: added input addon

This commit is contained in:
2025-05-27 19:20:46 +02:00
parent d8a1604af9
commit c8d8c7ec25
683 changed files with 21608 additions and 2 deletions

View File

@ -0,0 +1,20 @@
extends Node2D
@export var keyboard_and_mouse:GUIDEMappingContext
@export var controller:GUIDEMappingContext
@export var switch_to_controller:GUIDEAction
@export var switch_to_keyboard_and_mouse:GUIDEAction
func _ready():
# enable controller at the start
GUIDE.enable_mapping_context(controller)
# Switch the control scheme depending on the input.
switch_to_controller.triggered \
.connect(func(): GUIDE.enable_mapping_context(controller, true))
switch_to_keyboard_and_mouse.triggered \
.connect(func(): GUIDE.enable_mapping_context(keyboard_and_mouse, true))