tooltips and ui

This commit was merged in pull request #42.
This commit is contained in:
2026-07-02 20:57:06 +00:00
parent c296531214
commit 15f38c096b
91 changed files with 2105 additions and 556 deletions

View File

@@ -12,6 +12,9 @@ class_name IconButton
@export var images: Array[Texture]
@export var apply_texture_on_selection: bool = true
@export var enable_tooltip: bool = false
@export var tooltip_scene: PackedScene
@export var tooltip_image: Texture
func _ready():
if image != null and has_node("%Texture"):
@@ -36,3 +39,15 @@ func _on_pressed() -> void:
rotation = 0.0
modulate.a = 1.0
TweenFX.press_rotate(self)
func _make_custom_tooltip(for_text: String) -> Object:
if !enable_tooltip:
return null
var tooltip = tooltip_scene.instantiate()
tooltip.text = for_text
if tooltip_image != null:
tooltip.image = tooltip_image
return tooltip