super_space_game/addons/super_awesome_input_icons/textures/InputIconSprite3D.gd
ToasterPanic c2a76c206e Custom input icon system
I made it into a addon so I could share it seperately once I'm done with this project. Will probably add more stuff to it once I do that too
I liked Awesome Input Icons, but it only had a PlayStation icon face by default that couldn't be easily changed at runtime, so I just made my own.
2025-12-02 23:37:20 -05:00

17 lines
616 B
GDScript

## This is a Sprite3D that takes an action name and automatically loads the proper icon
class_name InputIconSprite3D extends Sprite3D
## The name of the action in your InputMap, it has to be an existing action
@export var action_name: StringName = &"":
set(value):
action_name = value
_update()
## The Index of the event, if you have more than one event in the same action.
## You can use negative numbers but not a number bigger than the number of events
@export var event_index: int = 0:
set(value):
event_index = value
_update()
func _update():
texture = InputIcon.get_icon(action_name, event_index)