4676b83b61
- Settings für Musik - Angefangen mit Wüstenbiom - Wolken Texture fix
37 lines
1.2 KiB
GDScript
37 lines
1.2 KiB
GDScript
extends TextureRect
|
|
|
|
var audio_bus_music = 1
|
|
var audio_bus_sounds = 2
|
|
var sound_button_on_of = {true:preload("res://assets/GUI/sound button.png"),false:preload("res://assets/GUI/sound button off.png")}
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
#$"../../Audio/Duckrun".volume_db = linear_to_db(20*0.01)
|
|
$AnimationPlayer.play_backwards("out-in")
|
|
hide()
|
|
|
|
func _process(_delta: float) -> void:
|
|
global_position.x = get_viewport().get_visible_rect().size.x -100
|
|
#$Logo.global_position.x = 0
|
|
|
|
func open():
|
|
show()
|
|
$AnimationPlayer.play_backwards("out-in")
|
|
$"../../Audio/Gui-in".play()
|
|
|
|
func _on_back_pressed() -> void:
|
|
$AnimationPlayer.play("out-in")
|
|
$"../../Audio/Gui-out".play()
|
|
await $AnimationPlayer.animation_finished
|
|
hide()
|
|
$"../StartSchild"._ready()
|
|
|
|
|
|
|
|
func _volume_slider_changed(value: float) -> void:
|
|
AudioServer.set_bus_volume_db(audio_bus_music,linear_to_db(value*0.01))
|
|
|
|
|
|
func _on_sound_button_toggled(toggled_on: bool) -> void:
|
|
$SoundToggleButton.texture_normal = sound_button_on_of[AudioServer.is_bus_mute(audio_bus_sounds)]
|
|
AudioServer.set_bus_mute(audio_bus_sounds,not AudioServer.is_bus_mute(audio_bus_sounds))
|