mirror of
https://git.kittycat.homes/BatHeartTiger/untitled-plant-game.git
synced 2024-08-15 03:16:27 +00:00
volume slider
This commit is contained in:
parent
7ab759a777
commit
cf3e10a880
25 changed files with 191 additions and 10 deletions
3
Menu/Theme.tres
Normal file
3
Menu/Theme.tres
Normal file
|
@ -0,0 +1,3 @@
|
|||
[gd_resource type="Theme" format=2]
|
||||
|
||||
[resource]
|
9
Menu/Volume.gd
Normal file
9
Menu/Volume.gd
Normal file
|
@ -0,0 +1,9 @@
|
|||
extends VSlider
|
||||
|
||||
export var bus_channel = "Master"
|
||||
|
||||
func _ready():
|
||||
value = db2linear(AudioServer.get_bus_volume_db(AudioServer.get_bus_index(bus_channel)))
|
||||
|
||||
func _on_MusicVolume_value_changed(value: float) -> void:
|
||||
AudioServer.set_bus_volume_db(AudioServer.get_bus_index(bus_channel), linear2db(value))
|
Loading…
Add table
Add a link
Reference in a new issue