Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_b2s_northernlightsroom_Draw_0

(view raw script w/o annotations or w/e)
1
if (active && 
scr_debug
scr_debug

function
scr_debug()
{ if (global.debug == 1) return 1; }
())
2
{
3
    if (obj_board_camera.con == 0)
4
        
scr_board_objname
scr_board_objname

function
scr_board_objname()
{ if (
scr_debug())
{ if (global.chemg_show_room) { var __cx = board_tilex(12) - 2; var __cy = board_tiley(0); if (argument_count >= 1) __cx = argument0; if (argument_count >= 2) __cy = argument1; draw_set_halign(fa_right); draw_set_font(fnt_main); draw_set_color(c_aqua); draw_text_outline(__cx, __cy, string_copy(object_get_name(object_index), 5, 99)); draw_set_font(fnt_small); draw_set_halign(fa_left); draw_set_color(c_white); } } }
();
5
    draw_set_halign(fa_left);
6
}
7
if (active && obj_board_camera.con == 0)
8
{
9
    timer++;
10
    if ((timer % 2) == 0 && timer > 0 && texttimer <= (string_length(shopstring) + 20))
11
    {
12
        texttimer++;
13
        if (texttimer < string_length(shopstring))
14
        {
15
            if (string_char_at(shopstring, texttimer) != " " && string_char_at(shopstring, texttimer) != "#")
16
            {
17
                if (type != 1)
18
                    snd_play(snd_board_text_main);
19
            }
20
        }
21
        if (texttimer == string_length(shopstring))
22
        {
23
            textcomplete = true;
24
            if (type != 1)
25
                snd_play(snd_board_text_main_end);
26
            north = snd_init("northernlight.ogg");
27
            if (type == 1)
28
                mus_loop(north);
29
        }
30
    }
31
    draw_set_font(fnt_8bit);
32
    draw_set_color(c_white);
33
    if (type == 2)
34
        draw_set_color(#5023D3);
35
    var currentstring = string_hash_to_newline(string_copy(shopstring, 1, texttimer));
36
    var txtwidth = string_width(string_hash_to_newline(shopstring));
37
    draw_text_ext((320 - (round(txtwidth) / 2)) + 4, board_tiley(2) + 12, currentstring, 24, 640);
38
    draw_set_color(c_white);
39
}