Added bg_sound manager and according ESC command.
Started transitions scene.
This commit is contained in:
BIN
addons/escoria-core/game/scenes/transitions/masks/curtain.png
Normal file
BIN
addons/escoria-core/game/scenes/transitions/masks/curtain.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 146 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 137 KiB |
BIN
addons/escoria-core/game/scenes/transitions/masks/shards.png
Normal file
BIN
addons/escoria-core/game/scenes/transitions/masks/shards.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
Binary file not shown.
28
addons/escoria-core/game/scenes/transitions/transition.gd
Normal file
28
addons/escoria-core/game/scenes/transitions/transition.gd
Normal file
@@ -0,0 +1,28 @@
|
||||
extends ColorRect
|
||||
|
||||
export(String, "fade_black", "fade_white", "transition_in", "transition_out") var transition_name
|
||||
# Reference to the _AnimationPlayer_ node
|
||||
onready var _anim_player := $AnimationPlayer
|
||||
|
||||
|
||||
|
||||
signal transition_done
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
# Plays the animation backward to fade in
|
||||
_anim_player.play_backwards(transition_name)
|
||||
|
||||
|
||||
func fade_out() -> void:
|
||||
# Plays the Fade animation and wait until it finishes
|
||||
_anim_player.play(transition_name)
|
||||
yield(_anim_player, "animation_finished")
|
||||
emit_signal("transition_done")
|
||||
|
||||
func fade_in() -> void:
|
||||
# Plays the Fade animation and wait until it finishes
|
||||
_anim_player.play_backwards(transition_name)
|
||||
yield(_anim_player, "animation_finished")
|
||||
emit_signal("transition_done")
|
||||
|
||||
83
addons/escoria-core/game/scenes/transitions/transition.tscn
Normal file
83
addons/escoria-core/game/scenes/transitions/transition.tscn
Normal file
@@ -0,0 +1,83 @@
|
||||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/scenes/transitions/transition.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/escoria-core/game/scenes/transitions/shaders/transition.material" type="Material" id=2]
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
resource_name = "fade_black"
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 0, 0, 0, 0 ), Color( 0, 0, 0, 1 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=2]
|
||||
resource_name = "fade_white"
|
||||
length = 0.5
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=3]
|
||||
resource_name = "transition_in"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:material:shader_param/cutoff")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 1 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ 0.0, 1.0 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=4]
|
||||
resource_name = "transition_out"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath(".:material:shader_param/cutoff")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 1 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ 1.0, 0.0 ]
|
||||
}
|
||||
|
||||
[node name="scene_transition" type="ColorRect"]
|
||||
material = ExtResource( 2 )
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
mouse_filter = 2
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
transition_name = "transition_out"
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
anims/fade_black = SubResource( 1 )
|
||||
anims/fade_white = SubResource( 2 )
|
||||
anims/transition_in = SubResource( 3 )
|
||||
anims/transition_out = SubResource( 4 )
|
||||
Reference in New Issue
Block a user