Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_trail_effect_Draw_0

(view raw script w/o annotations or w/e)
1
draw_set_color(start_color);
2
d_circle(x, y, width / 2, false);
3
var _col_a = start_color;
4
var _col_b = end_color;
5
var _lastpos = new Vector2(x, y);
6
var _pos = new Vector2(x, y);
7
surface_set_target(trail_surf);
8
draw_clear_alpha(c_black, 0);
9
var i = array_length(points) - 1;
10
while (i >= 0)
11
{
12
    points[i].color = merge_color(end_color, start_color, points[i].life);
13
    draw_set_color(points[i].color);
14
    i--;
15
}
16
draw_set_color(start_color);
17
d_circle(x, y, width / 2, false);
18
_col_b = end_color;
19
i = array_length(points) - 1;
20
while (i >= 0)
21
{
22
    _col_b = points[i].color;
23
    var _size = lerp(end_size, width, points[i].life);
24
    _pos.x = points[i].x;
25
    _pos.y = points[i].y;
26
    if (i < (array_length(points) - 1))
27
    {
28
        draw_set_color(_col_b);
29
        d_circle(points[i].x, points[i].y, lerp(end_size, width, points[i].life) / 2, false);
30
        d_line_width_color(_lastpos.x, _lastpos.y, _pos.x, _pos.y, _size, _col_a, _col_b);
31
    }
32
    _col_a = _col_b;
33
    _lastpos.x = _pos.x;
34
    _lastpos.y = _pos.y;
35
    i--;
36
}
37
d_line_width_color(_lastpos.x, _lastpos.y, x, y, width, start_color, _col_b);
38
surface_reset_target();
39
gpu_set_blendmode(bm_add);
40
draw_surface(trail_surf, 0, 0);
41
gpu_set_blendmode(bm_normal);