sound effects for the main menu
started working on this like 2 weeks ago
then stuff happened and now I forgot what I was doing 👍
This commit is contained in:
parent
ff8bd770d2
commit
18dae312eb
14 changed files with 127 additions and 85 deletions
|
@ -1,4 +1,7 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://tasbgr10p84c"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://tasbgr10p84c"]
|
||||
|
||||
[ext_resource type="AudioStream" uid="uid://bnbf1nfaxuagi" path="res://sounds/select.ogg" id="1_y8e4h"]
|
||||
[ext_resource type="AudioStream" uid="uid://bq3tw55s0ud55" path="res://sounds/confirm.ogg" id="2_hl3ms"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_18a3y"]
|
||||
script/source = "extends MarginContainer
|
||||
|
@ -26,6 +29,14 @@ func add(node: Control, return_button: bool):
|
|||
button.grow_vertical = Control.GROW_DIRECTION_BEGIN
|
||||
button.connect(\"pressed\", disable)
|
||||
node.add_child(button)
|
||||
|
||||
link_to_sounds(node)
|
||||
|
||||
func link_to_sounds(node: Control):
|
||||
var buttons := node.find_children(\"*\", \"Button\", true, false)
|
||||
for button in buttons as Array[Button]:
|
||||
button.mouse_entered.connect(func(): $Select.play())
|
||||
button.pressed.connect(func(): $Confirm.play())
|
||||
|
||||
func disable():
|
||||
$VSplitContainer/AnimationPlayer.play_backwards(\"split_offset\")
|
||||
|
@ -109,3 +120,11 @@ theme_override_constants/margin_top = 20
|
|||
[node name="ColorRect" type="ColorRect" parent="VSplitContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
color = Color(0, 0, 0, 1)
|
||||
|
||||
[node name="Select" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("1_y8e4h")
|
||||
bus = &"Sounds"
|
||||
|
||||
[node name="Confirm" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("2_hl3ms")
|
||||
bus = &"Sounds"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue