summaryrefslogtreecommitdiff
path: root/ui/bmp_texture_button.gd
diff options
context:
space:
mode:
Diffstat (limited to 'ui/bmp_texture_button.gd')
-rw-r--r--ui/bmp_texture_button.gd20
1 files changed, 20 insertions, 0 deletions
diff --git a/ui/bmp_texture_button.gd b/ui/bmp_texture_button.gd
new file mode 100644
index 0000000..23641e5
--- /dev/null
+++ b/ui/bmp_texture_button.gd
@@ -0,0 +1,20 @@
+extends TextureButton
+
+
+@export var background_colors: Array[Color] = [Color.MAGENTA]
+
+
+func _ready() -> void:
+ var texture_keys := [
+ "texture_normal",
+ "texture_pressed",
+ "texture_hover",
+ "texture_disabled",
+ "texture_focused",
+ ]
+
+ for texture_key in texture_keys:
+ if not self[texture_key]:
+ continue
+
+ self[texture_key] = BMPTexture.from_texture(self[texture_key], background_colors)