Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_knight_split_growtangle_effect_Draw_0

(view raw script w/o annotations or w/e)
1
if (!surface_exists(surf))
2
{
3
    surf = surface_create(640, 480);
4
    surface_copy(surf, 0, 0, application_surface);
5
    xmul = lengthdir_x(1, angle);
6
    ymul = lengthdir_y(1, angle);
7
}
8
timer++;
9
var _fade = (10 - timer) / 10;
10
var _htimer = (vertical ? 0 : timer) * xmul;
11
var _vtimer = (vertical ? timer : 0) * ymul;
12
var _splitwidth = sprite_width;
13
var _splitheight = sprite_height;
14
var _splitleft = 0;
15
var _splittop = 0;
16
if (vertical)
17
{
18
    _splitleft = sprite_width / 2;
19
    _splitwidth /= 2;
20
}
21
else
22
{
23
    _splittop = sprite_height / 2;
24
    _splitheight /= 2;
25
}
26
draw_sprite_part_ext_rot(sprite_index, 0, 0, 0, _splitwidth, _splitheight, x - (_htimer * 8), y - (_vtimer * 8), image_xscale, image_yscale, 0, image_blend, clamp01(_fade));
27
draw_sprite_part_ext_rot(sprite_index, 0, 0, 0, _splitwidth, _splitheight, x - (_htimer * 6), y - (_vtimer * 6), image_xscale, image_yscale, 0, image_blend, clamp01(_fade));
28
draw_sprite_part_ext_rot(sprite_index, 0, 0, 0, _splitwidth, _splitheight, x - (_htimer * 4), y - (_vtimer * 4), image_xscale, image_yscale, 0, image_blend, _fade);
29
draw_sprite_part_ext_rot(sprite_index, 0, _splitleft, _splittop, _splitwidth, _splitheight, x + (_htimer * 8), y + (_vtimer * 8), image_xscale, image_yscale, 0, image_blend, clamp01(_fade));
30
draw_sprite_part_ext_rot(sprite_index, 0, _splitleft, _splittop, _splitwidth, _splitheight, x + (_htimer * 6), y + (_vtimer * 6), image_xscale, image_yscale, 0, image_blend, clamp01(_fade));
31
draw_sprite_part_ext_rot(sprite_index, 0, _splitleft, _splittop, _splitwidth, _splitheight, x + (_htimer * 4), y + (_vtimer * 4), image_xscale, image_yscale, 0, image_blend, _fade);
32
var _sx = screenx();
33
var _sy = screeny();
34
if (vertical)
35
{
36
    draw_surface_part_ext(surf, 0, 0, _sx, 480, camerax(), cameray() - (timer * 8), 1, 1, 16777215, _fade / 2);
37
    draw_surface_part_ext(surf, 0, 0, 640 - _sx, 480, x, cameray() + (timer * 8), 1, 1, 16777215, _fade / 2);
38
}
39
else
40
{
41
    draw_surface_part_ext(surf, 0, 0, 640, _sy, camerax() - (timer * 8), cameray(), 1, 1, 16777215, _fade / 2);
42
    draw_surface_part_ext(surf, 0, _sy, 640, 480 - _sy, camerax() + (timer * 8), y, 1, 1, 16777215, _fade / 2);
43
}
44
draw_set_color(c_white);
45
var _angle = angle;
46
if (vertical)
47
    _angle += 90;
48
if (diagonal)
49
    _angle += 45;
50
draw_sprite_ext(spr_pxwhite10_center, 0, x + xoffset, y + yoffset, 50, _fade, _angle, c_white, 1);
51
draw_sprite_ext(spr_pxwhite10_center, 0, x + xoffset, y + yoffset, 50, _fade * 1.4, _angle, c_white, 0.5);
52
if (timer == 10)
53
    instance_destroy();