pegchamp/Menu/Buttons/AudioSliders/VolumeSlider.gd
2021-09-28 17:55:03 +02:00

9 lines
297 B
GDScript

extends HSlider
export var bus_channel = "Master"
func _ready():
value = db2linear(AudioServer.get_bus_volume_db(AudioServer.get_bus_index(bus_channel)))
func _on_MusicVolumeSlider_value_changed(value):
AudioServer.set_bus_volume_db(AudioServer.get_bus_index(bus_channel), linear2db(value))