ChocolateBird/widgets/ColorMenu.gd

26 lines
532 B
GDScript3
Raw Permalink Normal View History

2023-07-31 15:18:02 +09:30
extends Panel
var r := 0
var g := 0
var b := 16
func update_menu_color() -> void:
$label_nums.text = '\n%d\n%d\n%d' % [r, g, b]
ThemeManager.set_menu_color_555(r, g, b)
2023-07-31 15:18:02 +09:30
func _ready() -> void:
2023-09-21 15:26:10 +09:30
$'%slider_r'.value = r
$'%slider_g'.value = g
$'%slider_b'.value = b
2023-07-31 15:18:02 +09:30
func _on_slider_r_value_changed(value: float) -> void:
r = value
update_menu_color()
func _on_slider_g_value_changed(value: float) -> void:
g = value
update_menu_color()
func _on_slider_b_value_changed(value: float) -> void:
b = value
update_menu_color()