Improve card run animation

This commit is contained in:
2022-07-30 15:35:51 +01:00
parent 7040c0e09d
commit 53462325c8
5 changed files with 116 additions and 9 deletions

View File

@ -1,4 +1,3 @@
tool
extends Control
signal card_view_removed(card_view)
@ -81,8 +80,7 @@ func card_view_run(do_emit_signal : bool = true):
if do_emit_signal: emit_signal("card_view_removed", self)
# play the disappearing input dice animation
for i in input_dice_views:
yield(i.run_disappear_animation(), "completed")
play_input_dice_animations()
# play the using animation
$AnimationPlayer.play("Fly Off")
@ -104,6 +102,11 @@ func card_view_remove(do_emit_signal : bool = true):
queue_free()
func play_input_dice_animations():
for i in input_dice_views:
i.run_disappear_animation()
func disconnect_signals():
if card.get_signal_connection_list("card_removed") == []:
return

View File

@ -42,7 +42,7 @@ tracks/0/keys = {
[sub_resource type="Animation" id=7]
resource_name = "Fly Off"
length = 0.5
length = 1.5
step = 0.01
tracks/0/type = "value"
tracks/0/path = NodePath("LocalPosition:rect_position")
@ -51,10 +51,10 @@ tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.5 ),
"transitions": PoolRealArray( 5, 1 ),
"times": PoolRealArray( 0, 0.4, 0.65, 1.3 ),
"transitions": PoolRealArray( 0.647041, 0.647041, 4, 1 ),
"update": 0,
"values": [ Vector2( 0, 0 ), Vector2( 0, -999 ) ]
"values": [ Vector2( 0, 0 ), Vector2( 0, 0 ), Vector2( 0, 20 ), Vector2( 0, -700 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:rect_scale")
@ -63,11 +63,25 @@ tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.18, 0.5 ),
"times": PoolRealArray( 0, 0.65, 1.3 ),
"transitions": PoolRealArray( 1, 6.06286, 1 ),
"update": 0,
"values": [ Vector2( 1, 1 ), Vector2( 1, 1 ), Vector2( 1, 1.4 ) ]
}
tracks/2/type = "method"
tracks/2/path = NodePath(".")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ ],
"method": "play_input_dice_animations"
} ]
}
[sub_resource type="Animation" id=8]
length = 0.001
@ -108,6 +122,7 @@ script = ExtResource( 1 )
[node name="LocalPosition" type="Control" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_bottom = 6.10352e-05
[node name="Background" type="PanelContainer" parent="LocalPosition"]
unique_name_in_owner = true

View File

@ -71,6 +71,18 @@ tracks/2/keys = {
"update": 1,
"values": [ false, true ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Sprite/ExtraInfo:modulate")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0, 0.25 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
}
[sub_resource type="Animation" id=9]
length = 0.001
@ -110,6 +122,18 @@ tracks/2/keys = {
"update": 0,
"values": [ false ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Sprite/ExtraInfo:modulate")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ) ]
}
[node name="InputDiceView" type="Control"]
anchor_right = 1.0
@ -140,7 +164,7 @@ texture = ExtResource( 2 )
expand = true
stretch_mode = 6
[node name="ExtraInfo" type="Label" parent="."]
[node name="ExtraInfo" type="Label" parent="Sprite"]
unique_name_in_owner = true
anchor_right = 1.0
anchor_bottom = 1.0