Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_fx_zoom_camera_Draw_0

(view raw script w/o annotations or w/e)
1
if (init >= 1)
2
{
3
    size.x = 320;
4
    size.y = 240;
5
    surface_resize(cam_surf, size.x, size.y);
6
    surface_set_target(cam_surf);
7
    draw_clear(clear_color);
8
    surface_reset_target();
9
    surface_copy_part(cam_surf, 0, 0, application_surface, screenx(pos.x - (size.x / 2)), screeny(pos.y - (size.y / 2)), size.x, size.y);
10
}
11
if (init == 1)
12
    init = 2;
13
if (showcamera || i_ex(obj_debug_xy))
14
{
15
    draw_sprite_ext(sprite_index, 1, pos.x, pos.y, size.x / 64, size.y / 48, 0, c_white, 1);
16
    draw_sprite(sprite_index, 2, x, y);
17
    if (pos.x != x || pos.y != y)
18
    {
19
        var _col = merge_color(c_black, c_red, inverselerp(-1, 1, sin(siner / 15)));
20
        draw_sprite_ext(sprite_index, 1, x, y, size.x / 64, size.y / 48, 0, c_white, 1);
21
        draw_sprite(sprite_index, 2, x, y);
22
        siner++;
23
    }
24
    else
25
    {
26
        siner = 0;
27
    }
28
}