checheche/Robo-Bus-A31-HMI/Modules/volume_settings.gd
2024-12-11 23:26:40 +08:00

20 lines
609 B
GDScript

extends MarginContainer
@onready var h_slider: HSlider = $HSlider
@onready var texture_rect: TextureRect = %TextureRect
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
func _physics_process(delta: float) -> void:
h_slider.value = clampi(h_slider.value,40,140)
if h_slider.value <= 40:
texture_rect.texture = load("res://pad_hmi_ui/home/mute_icon.png")
else:
texture_rect.texture = load("res://pad_hmi_ui/home/sound_icon.png")
func _on_h_slider_drag_ended(value_changed: bool) -> void:
pass # Replace with function body.