Skip to content

Commit 7c67042

Browse files
committed
battle animation render texture to support filters
1 parent dda7ee9 commit 7c67042

File tree

2 files changed

+57
-10
lines changed

2 files changed

+57
-10
lines changed
Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,67 @@
11
{
22
"key_name": "ray",
3+
"cast_type": "psynergy_cast",
4+
"wait_for_cast_animation": true,
35
"lighting_sequence": [{
46
"start_delay": 100,
57
"from": {
6-
"pos": {"x": 60, "y": 17},
7-
"range_delta": {"x": 20}
8+
"pos": {"x": "targets", "y": 17},
9+
"range_delta": {"x": 25}
810
},
911
"to": {
10-
"pos": {"x": 60, "y": 137},
11-
"range_delta": {"x": 20}
12+
"pos": {"x": "targets", "y": "targets"},
13+
"range_delta": {"x": 25}
1214
},
13-
"count": 3,
14-
"duration": 1000,
15-
"interval_time": 1000,
15+
"count": 15,
16+
"duration": 600,
17+
"interval_time": 100,
1618
"trail_factor": 0.1,
1719
"trail": true,
1820
"glow": {
1921
"distance": 5,
20-
"r": 0.81,
22+
"r": 0.91,
2123
"g": 0.25,
2224
"b": 0.94,
23-
"strength": 2
25+
"strength": 0.1
2426
}
27+
}],
28+
"particles_sequence": [{
29+
"data": {
30+
"explosion" : {
31+
"red": 152,
32+
"green": 48,
33+
"blue": 240,
34+
"lifespan": 1000,
35+
"ay": 0.04,
36+
"velocity": {
37+
"initial": {"min": 0.7, "max": 6.0},
38+
"radial": { "arcStart": -90, "arcEnd": 90 },
39+
"control": [ { "x": 0, "y": 1 }, { "x": 0.5, "y": 0.75 }, { "x": 1, "y": 0.25 } ]
40+
}
41+
}
42+
},
43+
"zones": {},
44+
"emitters": [{
45+
"x": "targets",
46+
"y": "targets",
47+
"position": "between",
48+
"render_type": "pixel",
49+
"show_trails": true,
50+
"trails_clear_factor": 0.3,
51+
"pixel_size": 8,
52+
"pixel_reducing_factor": 0.1,
53+
"pixel_is_rect": false,
54+
"particles_display_blend_mode": "screen",
55+
"render_white_core": true,
56+
"core_custom_color": "rgba(255,255,255,0.85)",
57+
"total": 250,
58+
"frequency": 10,
59+
"emitter_data_key": "explosion",
60+
"delay": {
61+
"start": 1500,
62+
"visible": false
63+
}
64+
}],
65+
"emission_finish": 3000
2566
}]
2667
}

base/battle/BattleAnimation.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,7 @@ export class BattleAnimation {
14341434
this.ability_sprites_groups[group_pos].addChild(trail_image);
14351435
img.data.trail_image = trail_image;
14361436
img.data.trail_enabled = true;
1437+
img.data.render_texture = this.game.make.renderTexture(img.width, img.height);
14371438
}
14381439

14391440
const y_data = cumsum(random_normal(data_size, lighting_seq.roughness ?? 0.01, 0));
@@ -1981,7 +1982,12 @@ export class BattleAnimation {
19811982
if (sprite.data.keep_core_white) {
19821983
sprite.tint = sprite.data.color;
19831984
}
1984-
bm_data.draw(sprite);
1985+
if (sprite.data.render_texture) {
1986+
sprite.data.render_texture.renderXY(sprite, 0, 0);
1987+
bm_data.draw(sprite.data.render_texture);
1988+
} else {
1989+
bm_data.draw(sprite);
1990+
}
19851991
if (sprite.data.keep_core_white) {
19861992
sprite.tint = 0xffffff;
19871993
}

0 commit comments

Comments
 (0)