summaryrefslogtreecommitdiff
path: root/ui/bmp_texture_button.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-12-24 00:36:06 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-12-24 00:36:06 +0100
commit6e2deea3d1b2fb4d79dac02a0d4310936c7f317c (patch)
tree05590a7d9f7cecde037aad7a5487ff2c62176932 /ui/bmp_texture_button.gd
parent7b3f386449aeab124d84d2aff4c273e646e68763 (diff)
next commit
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)