diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2023-12-28 09:07:41 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2023-12-28 09:07:41 +0100 |
commit | 96d36cee33d6321834565f0a5d412ef95c5ceffd (patch) | |
tree | 0dec02c5915cc154d48eef6ac9c2cd0be7df7982 /Scenes/Utilities.gd | |
parent | 46556d864b9685c3b09a0038f5de83966fe7ff94 (diff) |
next commit
Diffstat (limited to 'Scenes/Utilities.gd')
-rw-r--r-- | Scenes/Utilities.gd | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Scenes/Utilities.gd b/Scenes/Utilities.gd index f9485ff..f7a5d5d 100644 --- a/Scenes/Utilities.gd +++ b/Scenes/Utilities.gd @@ -69,6 +69,18 @@ func fade_screen(from: Color, to: Color, duration: float = SCREEN_FADE_DURATION) return tween +func fade_bg_music(duration: float = SCREEN_FADE_DURATION): + if get_tree().current_scene.has_node("MusicBackground"): + var music = get_tree().current_scene.get_node("MusicBackground") + var tween = get_tree().create_tween() + tween.tween_property( + music, + "volume_db", + ProjectSettings.get_setting("audio/buses/channel_disable_threshold_db"), + duration + ) + + func get_collision_shape_bounds(collision_shape: CollisionShape2D): var shape: Shape2D = collision_shape.shape var bounds @@ -97,7 +109,7 @@ class Collision: func _init(node: Node2D, original_collision_shape: Node2D, expand: bool = true): self.name = "CollisionArea" - super() + #super() # setup area self.collision_layer = node.collision_layer |