Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_shopwriter_Draw_0

(view raw script w/o annotations or w/e)
1
if (active && obj_board_camera.con == 0)
2
{
3
    timer++;
4
    if ((timer % 2) == 0 && timer > 0 && texttimer <= (string_length(shopstring) + 20))
5
    {
6
        texttimer++;
7
        if (texttimer < string_length(shopstring))
8
        {
9
            textcomplete = false;
10
            if (string_char_at(shopstring, texttimer) != " " && string_char_at(shopstring, texttimer) != "#")
11
            {
12
                if (playsound)
13
                {
14
                    snd_stop(snd_board_text_main);
15
                    snd_play(snd_board_text_main);
16
                }
17
            }
18
        }
19
        if (texttimer == string_length(shopstring))
20
        {
21
            textcomplete = true;
22
            if (playsound)
23
            {
24
                snd_stop(snd_board_text_main);
25
                snd_stop(snd_board_text_main_end);
26
                snd_play(snd_board_text_main_end);
27
            }
28
        }
29
    }
30
    draw_set_font(
scr_84_get_font
scr_84_get_font

function
scr_84_get_font(arg0)
{ if (!variable_global_exists("chemg_last_get_font")) global.chemg_last_get_font = ""; if (arg0 != global.chemg_last_get_font) global.chemg_last_get_font = arg0; return ds_map_find_value(global.font_map, arg0); }
("8bit"));
31
    draw_set_color(textcol);
32
    var currentstring = string_hash_to_newline(string_copy(shopstring, 1, texttimer));
33
    var txtwidth = string_width(string_hash_to_newline(shopstring));
34
    if (drawtext)
35
    {
36
        draw_text_ext((320 - (round(txtwidth) / 2)) + 4 + xoff, yloc, currentstring, 24, 640);
37
        draw_set_halign(fa_left);
38
    }
39
    draw_set_color(c_white);
40
}