Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_dw_ch3_teevie_keyboard_tile_Create_0

(view raw script w/o annotations or w/e)
1
is_pressed = false;
2
char_string = "?";
3
char_sprite_index = 0;
4
char_y_offset = 0;
5
tile_index = 0;
6
7
init_button = function(arg0)
8
{
9
    char_string = arg0;
10
    if (ord(arg0) <= 57)
11
        char_sprite_index = ord(arg0) - 22;
12
    else
13
        char_sprite_index = ord(string_upper(arg0)) - 65;
14
};
15
16
press_button = function()
17
{
18
    is_pressed = true;
19
    char_y_offset = 4;
20
    tile_index = 1;
21
    snd_play(asset_get_index("snd_speak_and_spell_" + char_string));
22
};
23
24
reset_button = function()
25
{
26
    is_pressed = false;
27
    char_y_offset = 0;
28
    tile_index = 0;
29
};