Skip to content

Commit fccf69e

Browse files
Portrait-Animation fixes (#835)
* Fix scale issue in animations Because the animations should work both with Controls and Node2Ds, just using node.scale won't work. Now they all use DialogicAnimaPropertiesHelper.get_scale(node), which will automatically use the correct one. * Make sure "Wait for animation" + [No animation] doesn't freeze the game * Forgot one animation Thanks a lot to @zaknafean
1 parent 444ba9d commit fccf69e

File tree

16 files changed

+81
-66
lines changed

16 files changed

+81
-66
lines changed

addons/dialogic/Nodes/Anima/animations/attention_seeker/bounce.gd

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@ func generate_animation(anima_tween: Tween, data: Dictionary) -> void:
1111
{ percentage = 90, to = -4 },
1212
{ percentage = 100, to = +4 },
1313
]
14-
14+
15+
var scale = DialogicAnimaPropertiesHelper.get_scale(data.node)
1516
var scale_frames = [
16-
{ percentage = 0, to = 1 * data.node.scale.y },
17-
{ percentage = 20, to = 1 * data.node.scale.y },
18-
{ percentage = 40, to = 1.1 * data.node.scale.y, easing_points = [0.7555, 0.5, 0.8555, 0.06] },
19-
{ percentage = 43, to = 1.1 * data.node.scale.y, easing_points = [0.7555, 0.5, 0.8555, 0.06] },
20-
{ percentage = 53, to = 1 * data.node.scale.y },
21-
{ percentage = 70, to = 1.05 * data.node.scale.y, easing_points = [0.755, 0.05, 0.855, 0.06] },
22-
{ percentage = 80, to = 0.95 * data.node.scale.y },
23-
{ percentage = 90, to = 1.02 * data.node.scale.y },
24-
{ percentage = 100, to = 1 * data.node.scale.y },
17+
{ percentage = 0, to = 1 * scale.y },
18+
{ percentage = 20, to = 1 * scale.y },
19+
{ percentage = 40, to = 1.1 * scale.y, easing_points = [0.7555, 0.5, 0.8555, 0.06] },
20+
{ percentage = 43, to = 1.1 * scale.y, easing_points = [0.7555, 0.5, 0.8555, 0.06] },
21+
{ percentage = 53, to = 1 * scale.y },
22+
{ percentage = 70, to = 1.05 * scale.y, easing_points = [0.755, 0.05, 0.855, 0.06] },
23+
{ percentage = 80, to = 0.95 * scale.y },
24+
{ percentage = 90, to = 1.02 * scale.y },
25+
{ percentage = 100, to = 1 * scale.y },
2526
]
2627

2728
anima_tween.add_relative_frames(data, "Y", bounce_frames)

addons/dialogic/Nodes/Anima/animations/attention_seeker/heartbeat.gd

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
func generate_animation(anima_tween: Tween, data: Dictionary) -> void:
2+
var scale = DialogicAnimaPropertiesHelper.get_scale(data.node)
23
var frames = [
3-
{ percentage = 0, from = data.node.scale * Vector2(1, 1) },
4-
{ percentage = 14, to = data.node.scale * Vector2(1.3, 1.3) },
5-
{ percentage = 28, to = data.node.scale * Vector2(1, 1) },
6-
{ percentage = 42, to = data.node.scale * Vector2(1.3, 1.3) },
7-
{ percentage = 70, to = data.node.scale * Vector2(1, 1) },
8-
{ percentage = 100, to = data.node.scale * Vector2(1, 1) },
4+
{ percentage = 0, from = scale * Vector2(1, 1) },
5+
{ percentage = 14, to = scale * Vector2(1.3, 1.3) },
6+
{ percentage = 28, to = scale * Vector2(1, 1) },
7+
{ percentage = 42, to = scale * Vector2(1.3, 1.3) },
8+
{ percentage = 70, to = scale * Vector2(1, 1) },
9+
{ percentage = 100, to = scale * Vector2(1, 1) },
910
]
1011

1112
DialogicAnimaPropertiesHelper.set_2D_pivot(data.node, DialogicAnimaPropertiesHelper.PIVOT.CENTER)

addons/dialogic/Nodes/Anima/animations/attention_seeker/pulse.gd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
func generate_animation(anima_tween: Tween, data: Dictionary) -> void:
2+
3+
var scale = DialogicAnimaPropertiesHelper.get_scale(data.node)
24
var frames = [
3-
{ percentage = 0, from = data.node.scale * Vector2(1, 1) },
4-
{ percentage = 50, to = data.node.scale * Vector2(1.05, 1.05), easing = anima_tween.EASING.EASE_IN_OUT_SINE },
5-
{ percentage = 100, to = data.node.scale * Vector2(1, 1) },
5+
{ percentage = 0, from = scale * Vector2(1, 1) },
6+
{ percentage = 50, to = scale * Vector2(1.05, 1.05), easing = anima_tween.EASING.EASE_IN_OUT_SINE },
7+
{ percentage = 100, to = scale * Vector2(1, 1) },
68
]
79

810
DialogicAnimaPropertiesHelper.set_2D_pivot(data.node, DialogicAnimaPropertiesHelper.PIVOT.CENTER)

addons/dialogic/Nodes/Anima/animations/attention_seeker/rubber_band.gd

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
func generate_animation(anima_tween: Tween, data: Dictionary) -> void:
2+
var scale = DialogicAnimaPropertiesHelper.get_scale(data.node)
23
var frames = [
3-
{ percentage = 0, from = data.node.scale * Vector2(1, 1) },
4-
{ percentage = 30, to = data.node.scale * Vector2(1.25, 0.75) },
5-
{ percentage = 40, to = data.node.scale * Vector2(0.75, 1.25) },
6-
{ percentage = 50, to = data.node.scale * Vector2(1.15, 0.85) },
7-
{ percentage = 65, to = data.node.scale * Vector2(0.95, 1.05) },
8-
{ percentage = 75, to = data.node.scale * Vector2(1.05, 0.95) },
9-
{ percentage = 100, to = data.node.scale * Vector2(1, 1) },
4+
{ percentage = 0, from = scale * Vector2(1, 1) },
5+
{ percentage = 30, to = scale * Vector2(1.25, 0.75) },
6+
{ percentage = 40, to = scale * Vector2(0.75, 1.25) },
7+
{ percentage = 50, to = scale * Vector2(1.15, 0.85) },
8+
{ percentage = 65, to = scale * Vector2(0.95, 1.05) },
9+
{ percentage = 75, to = scale * Vector2(1.05, 0.95) },
10+
{ percentage = 100, to = scale * Vector2(1, 1) },
1011
]
1112

1213
DialogicAnimaPropertiesHelper.set_2D_pivot(data.node, DialogicAnimaPropertiesHelper.PIVOT.CENTER)

addons/dialogic/Nodes/Anima/animations/attention_seeker/tada.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ func generate_animation(anima_tween: Tween, data: Dictionary) -> void:
33
{ percentage = 0, from = 0 },
44
]
55
var scale_frames = [
6-
{ percentage = 0, from = data.node.scale * Vector2(1, 1) },
6+
{ percentage = 0, from = DialogicAnimaPropertiesHelper.get_scale(data.node) * Vector2(1, 1) },
77
]
88

99
for index in range(2, 9):

addons/dialogic/Nodes/Anima/animations/entrances_and_exits/back_in_down.gd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ func generate_animation(anima_tween: Tween, data: Dictionary) -> void:
55
{ percentage = 100, to = 0 },
66
]
77

8+
var scale = DialogicAnimaPropertiesHelper.get_scale(data.node)
89
var scale_frames = [
9-
{ percentage = 0, from = data.node.scale * Vector2(0.7, 0.7) },
10-
{ percentage = 80, to = data.node.scale * Vector2(0.7, 0.7) },
11-
{ percentage = 100, to = data.node.scale * Vector2(1, 1) },
10+
{ percentage = 0, from = scale * Vector2(0.7, 0.7) },
11+
{ percentage = 80, to = scale * Vector2(0.7, 0.7) },
12+
{ percentage = 100, to = scale * Vector2(1, 1) },
1213
]
1314

1415
var opacity_frames = [

addons/dialogic/Nodes/Anima/animations/entrances_and_exits/back_in_left.gd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ func generate_animation(anima_tween: Tween, data: Dictionary) -> void:
55
{ percentage = 100, to = 0 },
66
]
77

8+
var scale = DialogicAnimaPropertiesHelper.get_scale(data.node)
89
var scale_frames = [
9-
{ percentage = 0, from = data.node.scale * Vector2(0.7, 0.7) },
10-
{ percentage = 80, to = data.node.scale * Vector2(0.7, 0.7) },
11-
{ percentage = 100, to = data.node.scale * Vector2(1, 1) },
10+
{ percentage = 0, from = scale * Vector2(0.7, 0.7) },
11+
{ percentage = 80, to = scale * Vector2(0.7, 0.7) },
12+
{ percentage = 100, to = scale * Vector2(1, 1) },
1213
]
1314

1415
var opacity_frames = [

addons/dialogic/Nodes/Anima/animations/entrances_and_exits/back_in_right.gd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ func generate_animation(anima_tween: Tween, data: Dictionary) -> void:
55
{ percentage = 100, to = 0 },
66
]
77

8+
var scale = DialogicAnimaPropertiesHelper.get_scale(data.node)
89
var scale_frames = [
9-
{ percentage = 0, from = data.node.scale * Vector2(0.7, 0.7) },
10-
{ percentage = 80, to = data.node.scale * Vector2(0.7, 0.7) },
11-
{ percentage = 100, to = data.node.scale * Vector2(1, 1) },
10+
{ percentage = 0, from = scale * Vector2(0.7, 0.7) },
11+
{ percentage = 80, to = scale * Vector2(0.7, 0.7) },
12+
{ percentage = 100, to = scale * Vector2(1, 1) },
1213
]
1314

1415
var opacity_frames = [

addons/dialogic/Nodes/Anima/animations/entrances_and_exits/back_in_up.gd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ func generate_animation(anima_tween: Tween, data: Dictionary) -> void:
55
{ percentage = 100, to = 0 },
66
]
77

8+
var scale = DialogicAnimaPropertiesHelper.get_scale(data.node)
89
var scale_frames = [
9-
{ percentage = 0, from = data.node.scale * Vector2(0.7, 0.7) },
10-
{ percentage = 80, to = data.node.scale * Vector2(0.7, 0.7) },
11-
{ percentage = 100, to = data.node.scale * Vector2(1, 1) },
10+
{ percentage = 0, from = scale * Vector2(0.7, 0.7) },
11+
{ percentage = 80, to = scale * Vector2(0.7, 0.7) },
12+
{ percentage = 100, to = scale * Vector2(1, 1) },
1213
]
1314

1415
var opacity_frames = [

addons/dialogic/Nodes/Anima/animations/entrances_and_exits/back_out_down.gd

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ func generate_animation(anima_tween: Tween, data: Dictionary) -> void:
44
{ percentage = 20, to = 0 },
55
{ percentage = 100, to = -700 },
66
]
7-
7+
8+
var scale = DialogicAnimaPropertiesHelper.get_scale(data.node)
89
var scale_frames = [
9-
{ percentage = 0, from = data.node.scale * Vector2(1, 1) },
10-
{ percentage = 20, to = data.node.scale * Vector2(0.7, 0.7) },
11-
{ percentage = 100, to = data.node.scale * Vector2(0.7, 0.7) },
10+
{ percentage = 0, from = scale * Vector2(1, 1) },
11+
{ percentage = 20, to = scale * Vector2(0.7, 0.7) },
12+
{ percentage = 100, to = scale * Vector2(0.7, 0.7) },
1213
]
1314

1415
var opacity_frames = [

0 commit comments

Comments
 (0)