Deltarune (Chapter 4) script viewer

← back to main script listing

gml_GlobalScript_scr_darkbox

(view raw script w/o annotations or w/e)
1
function scr_darkbox
scr_darkbox

function scr_darkbox(arg0, arg1, arg2, arg3) { if (!variable_instance_exists(id, "cur_jewel")) cur_jewel = 0; cur_jewel += 1; textbox_width = arg2 - arg0 - 63; if (textbox_width < 0) textbox_width = 0; textbox_height = arg3 - arg1 - 63; if (textbox_height < 0) textbox_height = 0; if (textbox_width > 0) { draw_sprite_stretched(spr_textbox_top, 0, arg0 + 32, arg1, textbox_width, 32); draw_sprite_ext(spr_textbox_top, 0, arg0 + 32, arg3 + 1, textbox_width, -2, 0, c_white, 1); } if (textbox_height > 0) { draw_sprite_ext(spr_textbox_left, 0, arg2 + 1, arg1 + 32, -2, textbox_height, 0, c_white, 1); draw_sprite_ext(spr_textbox_left, 0, arg0, arg1 + 32, 2, textbox_height, 0, c_white, 1); } if (global.flag[8 simplify_vfx] == 0) { draw_sprite_ext(spr_textbox_topleft, cur_jewel / 10, arg0, arg1, 2, 2, 0, c_white, 1); draw_sprite_ext(spr_textbox_topleft, cur_jewel / 10, arg2 + 1, arg1, -2, 2, 0, c_white, 1); draw_sprite_ext(spr_textbox_topleft, cur_jewel / 10, arg0, arg3 + 1, 2, -2, 0, c_white, 1); draw_sprite_ext(spr_textbox_topleft, cur_jewel / 10, arg2 + 1, arg3 + 1, -2, -2, 0, c_white, 1); } else { draw_sprite_ext(spr_textbox_topleft, 0, arg0, arg1, 2, 2, 0, c_white, 1); draw_sprite_ext(spr_textbox_topleft, 0, arg2 + 1, arg1, -2, 2, 0, c_white, 1); draw_sprite_ext(spr_textbox_topleft, 0, arg0, arg3 + 1, 2, -2, 0, c_white, 1); draw_sprite_ext(spr_textbox_topleft, 0, arg2 + 1, arg3 + 1, -2, -2, 0, c_white, 1); } }
(arg0, arg1, arg2, arg3)
2
{
3
    if (!variable_instance_exists(id, "cur_jewel"))
4
        cur_jewel = 0;
5
    cur_jewel += 1;
6
    textbox_width = arg2 - arg0 - 63;
7
    if (textbox_width < 0)
8
        textbox_width = 0;
9
    textbox_height = arg3 - arg1 - 63;
10
    if (textbox_height < 0)
11
        textbox_height = 0;
12
    if (textbox_width > 0)
13
    {
14
        draw_sprite_stretched(spr_textbox_top, 0, arg0 + 32, arg1, textbox_width, 32);
15
        draw_sprite_ext(spr_textbox_top, 0, arg0 + 32, arg3 + 1, textbox_width, -2, 0, c_white, 1);
16
    }
17
    if (textbox_height > 0)
18
    {
19
        draw_sprite_ext(spr_textbox_left, 0, arg2 + 1, arg1 + 32, -2, textbox_height, 0, c_white, 1);
20
        draw_sprite_ext(spr_textbox_left, 0, arg0, arg1 + 32, 2, textbox_height, 0, c_white, 1);
21
    }
22
    if (global.flag[8 simplify_vfx] == 0)
23
    {
24
        draw_sprite_ext(spr_textbox_topleft, cur_jewel / 10, arg0, arg1, 2, 2, 0, c_white, 1);
25
        draw_sprite_ext(spr_textbox_topleft, cur_jewel / 10, arg2 + 1, arg1, -2, 2, 0, c_white, 1);
26
        draw_sprite_ext(spr_textbox_topleft, cur_jewel / 10, arg0, arg3 + 1, 2, -2, 0, c_white, 1);
27
        draw_sprite_ext(spr_textbox_topleft, cur_jewel / 10, arg2 + 1, arg3 + 1, -2, -2, 0, c_white, 1);
28
    }
29
    else
30
    {
31
        draw_sprite_ext(spr_textbox_topleft, 0, arg0, arg1, 2, 2, 0, c_white, 1);
32
        draw_sprite_ext(spr_textbox_topleft, 0, arg2 + 1, arg1, -2, 2, 0, c_white, 1);
33
        draw_sprite_ext(spr_textbox_topleft, 0, arg0, arg3 + 1, 2, -2, 0, c_white, 1);
34
        draw_sprite_ext(spr_textbox_topleft, 0, arg2 + 1, arg3 + 1, -2, -2, 0, c_white, 1);
35
    }
36
}