Files
EGJ25/addons/guide/ui/renderers/keyboard/key_renderer.gd
minimata 9a79715e47
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 6s
Create tag and build when new code gets to main / Export (push) Successful in 3m16s
feat: made sure the aspect ration fit a pixel art game and added useful addons
2025-06-27 15:19:12 +02:00

18 lines
496 B
GDScript

@tool
extends GUIDEIconRenderer
@onready var _label:Label = %Label
func supports(input:GUIDEInput) -> bool:
return input is GUIDEInputKey
func render(input:GUIDEInput) -> void:
var key:Key = input.key
var label_key:Key = DisplayServer.keyboard_get_label_from_physical(key)
_label.text = OS.get_keycode_string(label_key).strip_edges()
size = Vector2.ZERO
call("queue_sort")
func cache_key(input:GUIDEInput) -> String:
return "ed6923d5-4115-44bd-b35e-2c4102ffc83e" + input.to_string()