From 6e2deea3d1b2fb4d79dac02a0d4310936c7f317c Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Tue, 24 Dec 2024 00:36:06 +0100 Subject: next commit --- ui/bmp_texture_button.gd | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ui/bmp_texture_button.gd (limited to 'ui/bmp_texture_button.gd') 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) -- cgit v1.2.3