Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_darkshape_Draw_0

(view raw script w/o annotations or w/e)
1
if (!surface_exists(my_surface))
2
    my_surface = surface_create(46, 46);
3
surface_set_target(my_surface);
4
draw_clear_alpha(c_black, 0);
5
if (image != 0)
6
    draw_sprite_ext(shrink_sprite, image, 23, 23, xscale, yscale, image_angle, image_blend, image_alpha);
7
else
8
    draw_sprite_ext(sprite_index, (timer + individuality) * 0.25, 23, 23, xscale, yscale, image_angle, image_blend, image_alpha);
9
surface_reset_target();
10
var xoff = 0;
11
var yoff = 0;
12
if (shakeme)
13
{
14
    xoff = choose(-1, 0, 1);
15
    yoff = choose(-1, 0, 1);
16
}
17
for (a = 0; a < 46; a++)
18
{
19
    var side = 1;
20
    draw_surface_part(my_surface, 0, a, 46, 1, (x - 22) + (sin((a + timer) * 1) * (4 - (image_alpha * 4)) * side) + xoff, (y - 23) + a + yoff);
21
}
22
if (light > 0)
23
{
24
    d3d_set_fog(true, c_white, 0, 0);
25
    if (image != 0)
26
        draw_sprite_ext(shrink_sprite, image, x + 1 + xoff, y + yoff, xscale, yscale, image_angle, image_blend, light);
27
    else
28
        draw_sprite_ext(sprite_index, (timer + individuality) * 0.25, x + 1 + xoff, y + yoff, xscale, xscale, image_angle, image_blend, light);
29
    d3d_set_fog(false, c_white, 0, 0);
30
}