Added volume bar and song list and refactored character select
This commit is contained in:
15
volume_slider.gd
Normal file
15
volume_slider.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
extends HSlider
|
||||
|
||||
@export
|
||||
var audio_bus_name := "music"
|
||||
|
||||
@onready
|
||||
var _bus: int
|
||||
|
||||
func _ready():
|
||||
_bus = AudioServer.get_bus_index(audio_bus_name)
|
||||
value_changed.connect(_on_value_changed)
|
||||
value = db_to_linear(AudioServer.get_bus_volume_db(_bus))
|
||||
|
||||
func _on_value_changed(value: float) -> void:
|
||||
AudioServer.set_bus_volume_db(_bus, linear_to_db(value))
|
||||
Reference in New Issue
Block a user