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,26 @@
# This component shows a progress bar for the hold time, indicating to the player
# that they must keep touching the screen until something is placed.
extends Node2D
@export var spawn:GUIDEAction
@onready var texture_progress_bar:TextureProgressBar = %TextureProgressBar
func _ready():
visible = false
# While the hold trigger is evaluating show the progress bar
spawn.ongoing.connect(_show)
# Once it is done, hide it again
spawn.triggered.connect(_hide)
# Same when it was cancelled
spawn.cancelled.connect(_hide)
func _show():
# show the indicator
visible = true
# move it to where we would spawn
global_position = spawn.value_axis_2d
# and update the progress bar
texture_progress_bar.value = spawn.elapsed_seconds
func _hide():
visible = false