Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_gameshow_nameentry_Draw_0

(view raw script w/o annotations or w/e)
1
var lang = 0;
2
if (global.lang == "ja")
3
    lang = 1;
4
mystring = "";
5
for (var i = 0; i < clamp(con + 1 + lang, 0, 3); i++)
6
    mystring += alphanumericarray[letter[i]];
7
draw_set_font(fnt_main);
8
if (lang == 1)
9
    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"));
10
draw_set_color(c_black);
11
draw_set_alpha(0.25);
12
var xpos = x - 17 - (lang * 2);
13
var ypos = (y - 50) + (lang * 9);
14
var scale = 2 - lang;
15
for (var i = 0; i < string_length(mystring); i++)
16
    draw_text_transformed((xpos + (16 * i)) - 2, ypos + 2, string_char_at(mystring, i + 1), scale, scale, 0);
17
draw_set_alpha(1);
18
draw_set_color(mycolor);
19
for (var i = 0; i < string_length(mystring); i++)
20
    draw_text_transformed((xpos + (16 * i)) - 2, ypos, string_char_at(mystring, i + 1), scale, scale, 0);
21
draw_set_color(c_white);
22
if (con < 3)
23
{
24
    timer++;
25
    var upcol = merge_color(c_white, #00A3EA, up_h());
26
    var downcol = merge_color(c_white, #00A3EA, down_h());
27
    var sinmod = round(abs(sin(timer / 8) * 6) / 2) * 2;
28
    draw_sprite_ext(spr_gameshow_nameentry_arrow, 0, (x - 5) + (con * 16) + 2, (y - 44 - sinmod) + 2, 2, 2, 180, c_black, 0.25);
29
    draw_sprite_ext(spr_gameshow_nameentry_arrow, 0, (x - 5) + (con * 16), y - 44 - sinmod, 2, 2, 180, upcol, 1);
30
    draw_sprite_ext(spr_gameshow_nameentry_arrow, 0, (x - 21) + (con * 16) + 2, (y - 22) + sinmod + 2, 2, 2, 0, c_black, 0.25);
31
    draw_sprite_ext(spr_gameshow_nameentry_arrow, 0, (x - 21) + (con * 16), (y - 22) + sinmod, 2, 2, 0, downcol, 1);
32
}
33
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); }
("mainbig"));
34
strchange = stringsetloc(
Change Letter
"Change Letter", "obj_gameshow_nameentry_slash_Draw_0_gml_41_0"
);
35
strnext = stringsetloc(
Next Letter
"Next Letter", "obj_gameshow_nameentry_slash_Draw_0_gml_42_0"
);
36
strprev = stringsetloc(
Previous Letter
"Previous Letter", "obj_gameshow_nameentry_slash_Draw_0_gml_43_0"
);
37
var _xx = camerax();
38
var _yy = cameray();
39
if (controller_active)
40
{
41
    draw_sprite_ext(
scr_getbuttonsprite
scr_getbuttonsprite

function
scr_getbuttonsprite(arg0, arg1)
{ var control = arg0; var isString = arg1; var button = noone; var is_dualshock = os_type == os_ps4 || global.gamepad_type == "Sony DualShock 4"; var is_dualsense = os_type == os_ps5 || global.gamepad_type == "DualSense Wireless Controller"; var button_sprite = button_questionmark; var invert = is_dualshock && (global.typer == 50 || global.typer == 70 || global.typer == 71); if (isString) { if (control == "A") { button_sprite = button_xbox_left; if (scr_is_switch_os()) { button_sprite = button_switch_left_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_left_dark : button_ps4_dpad_left; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_left_dark : button_ps5_dpad_left; } return button_sprite; } if (control == "D") { button_sprite = button_xbox_right; if (scr_is_switch_os()) { button_sprite = button_switch_right_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_right_dark : button_ps4_dpad_right; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_right_dark : button_ps5_dpad_right; } return button_sprite; } if (control == "W") { button_sprite = button_xbox_up; if (scr_is_switch_os()) { button_sprite = button_switch_up_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_up_dark : button_ps4_dpad_up; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_up_dark : button_ps5_dpad_up; } return button_sprite; } if (control == "S") { button_sprite = button_xbox_down; if (scr_is_switch_os()) { button_sprite = button_switch_down_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_down_dark : button_ps4_dpad_down; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_down_dark : button_ps5_dpad_down; } return button_sprite; } if (control == "l") { button_sprite = button_xbox_left_bumper; if (is_dualshock || is_dualsense) { button_sprite = button_ps4_l1; if (is_dualsense) button_sprite = button_ps5_l1; } if (scr_is_switch_os()) button_sprite = button_switch_l_0; return button_sprite; } if (control == "L") { button_sprite = button_xbox_left_trigger; if (is_dualshock || is_dualsense) { button_sprite = button_ps4_l2; if (is_dualsense) button_sprite = button_ps5_l2; } if (scr_is_switch_os()) button_sprite = button_switch_zl_0; return button_sprite; } if (control == "r") { button_sprite = button_xbox_right_bumper; if (is_dualshock || is_dualsense) ...
(global.input_g[2], false), 0, _xx + 32, ((_yy + 480) - 70) + 1 + (tutprog * 80), 2, 2, 0, c_white, 1);
42
    draw_sprite_ext(
scr_getbuttonsprite
scr_getbuttonsprite

function
scr_getbuttonsprite(arg0, arg1)
{ var control = arg0; var isString = arg1; var button = noone; var is_dualshock = os_type == os_ps4 || global.gamepad_type == "Sony DualShock 4"; var is_dualsense = os_type == os_ps5 || global.gamepad_type == "DualSense Wireless Controller"; var button_sprite = button_questionmark; var invert = is_dualshock && (global.typer == 50 || global.typer == 70 || global.typer == 71); if (isString) { if (control == "A") { button_sprite = button_xbox_left; if (scr_is_switch_os()) { button_sprite = button_switch_left_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_left_dark : button_ps4_dpad_left; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_left_dark : button_ps5_dpad_left; } return button_sprite; } if (control == "D") { button_sprite = button_xbox_right; if (scr_is_switch_os()) { button_sprite = button_switch_right_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_right_dark : button_ps4_dpad_right; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_right_dark : button_ps5_dpad_right; } return button_sprite; } if (control == "W") { button_sprite = button_xbox_up; if (scr_is_switch_os()) { button_sprite = button_switch_up_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_up_dark : button_ps4_dpad_up; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_up_dark : button_ps5_dpad_up; } return button_sprite; } if (control == "S") { button_sprite = button_xbox_down; if (scr_is_switch_os()) { button_sprite = button_switch_down_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_down_dark : button_ps4_dpad_down; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_down_dark : button_ps5_dpad_down; } return button_sprite; } if (control == "l") { button_sprite = button_xbox_left_bumper; if (is_dualshock || is_dualsense) { button_sprite = button_ps4_l1; if (is_dualsense) button_sprite = button_ps5_l1; } if (scr_is_switch_os()) button_sprite = button_switch_l_0; return button_sprite; } if (control == "L") { button_sprite = button_xbox_left_trigger; if (is_dualshock || is_dualsense) { button_sprite = button_ps4_l2; if (is_dualsense) button_sprite = button_ps5_l2; } if (scr_is_switch_os()) button_sprite = button_switch_zl_0; return button_sprite; } if (control == "r") { button_sprite = button_xbox_right_bumper; if (is_dualshock || is_dualsense) ...
(global.input_g[0], false), 0, _xx + 32 + 65, ((_yy + 480) - 70) + 1 + (tutprog * 80), 2, 2, 0, c_white, 1);
43
    draw_sprite_ext(
scr_getbuttonsprite
scr_getbuttonsprite

function
scr_getbuttonsprite(arg0, arg1)
{ var control = arg0; var isString = arg1; var button = noone; var is_dualshock = os_type == os_ps4 || global.gamepad_type == "Sony DualShock 4"; var is_dualsense = os_type == os_ps5 || global.gamepad_type == "DualSense Wireless Controller"; var button_sprite = button_questionmark; var invert = is_dualshock && (global.typer == 50 || global.typer == 70 || global.typer == 71); if (isString) { if (control == "A") { button_sprite = button_xbox_left; if (scr_is_switch_os()) { button_sprite = button_switch_left_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_left_dark : button_ps4_dpad_left; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_left_dark : button_ps5_dpad_left; } return button_sprite; } if (control == "D") { button_sprite = button_xbox_right; if (scr_is_switch_os()) { button_sprite = button_switch_right_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_right_dark : button_ps4_dpad_right; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_right_dark : button_ps5_dpad_right; } return button_sprite; } if (control == "W") { button_sprite = button_xbox_up; if (scr_is_switch_os()) { button_sprite = button_switch_up_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_up_dark : button_ps4_dpad_up; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_up_dark : button_ps5_dpad_up; } return button_sprite; } if (control == "S") { button_sprite = button_xbox_down; if (scr_is_switch_os()) { button_sprite = button_switch_down_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_down_dark : button_ps4_dpad_down; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_down_dark : button_ps5_dpad_down; } return button_sprite; } if (control == "l") { button_sprite = button_xbox_left_bumper; if (is_dualshock || is_dualsense) { button_sprite = button_ps4_l1; if (is_dualsense) button_sprite = button_ps5_l1; } if (scr_is_switch_os()) button_sprite = button_switch_l_0; return button_sprite; } if (control == "L") { button_sprite = button_xbox_left_trigger; if (is_dualshock || is_dualsense) { button_sprite = button_ps4_l2; if (is_dualsense) button_sprite = button_ps5_l2; } if (scr_is_switch_os()) button_sprite = button_switch_zl_0; return button_sprite; } if (control == "r") { button_sprite = button_xbox_right_bumper; if (is_dualshock || is_dualsense) ...
(global.input_g[4], false), 0, (_xx + 640) - 234, ((_yy + 480) - 67) + 1 + (tutprog * 80), 2, 2, 0, c_white, 1);
44
    draw_sprite_ext(
scr_getbuttonsprite
scr_getbuttonsprite

function
scr_getbuttonsprite(arg0, arg1)
{ var control = arg0; var isString = arg1; var button = noone; var is_dualshock = os_type == os_ps4 || global.gamepad_type == "Sony DualShock 4"; var is_dualsense = os_type == os_ps5 || global.gamepad_type == "DualSense Wireless Controller"; var button_sprite = button_questionmark; var invert = is_dualshock && (global.typer == 50 || global.typer == 70 || global.typer == 71); if (isString) { if (control == "A") { button_sprite = button_xbox_left; if (scr_is_switch_os()) { button_sprite = button_switch_left_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_left_dark : button_ps4_dpad_left; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_left_dark : button_ps5_dpad_left; } return button_sprite; } if (control == "D") { button_sprite = button_xbox_right; if (scr_is_switch_os()) { button_sprite = button_switch_right_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_right_dark : button_ps4_dpad_right; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_right_dark : button_ps5_dpad_right; } return button_sprite; } if (control == "W") { button_sprite = button_xbox_up; if (scr_is_switch_os()) { button_sprite = button_switch_up_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_up_dark : button_ps4_dpad_up; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_up_dark : button_ps5_dpad_up; } return button_sprite; } if (control == "S") { button_sprite = button_xbox_down; if (scr_is_switch_os()) { button_sprite = button_switch_down_0; } else if (is_dualshock || is_dualsense) { button_sprite = invert ? button_ps4_dpad_down_dark : button_ps4_dpad_down; if (is_dualsense) button_sprite = invert ? button_ps4_dpad_down_dark : button_ps5_dpad_down; } return button_sprite; } if (control == "l") { button_sprite = button_xbox_left_bumper; if (is_dualshock || is_dualsense) { button_sprite = button_ps4_l1; if (is_dualsense) button_sprite = button_ps5_l1; } if (scr_is_switch_os()) button_sprite = button_switch_l_0; return button_sprite; } if (control == "L") { button_sprite = button_xbox_left_trigger; if (is_dualshock || is_dualsense) { button_sprite = button_ps4_l2; if (is_dualsense) button_sprite = button_ps5_l2; } if (scr_is_switch_os()) button_sprite = button_switch_zl_0; return button_sprite; } if (control == "r") { button_sprite = button_xbox_right_bumper; if (is_dualshock || is_dualsense) ...
(global.input_g[5], false), 0, (_xx + 640) - 298, ((_yy + 480) - 37) + (tutprog * 80), 2, 2, 0, c_white, 1);
45
    draw_set_halign(fa_left);
46
    draw_set_color(#003A52);
47
    draw_text(_xx + 14 + 60, ((_yy + 480) - 70) + 2 + (tutprog * 80), "/");
48
    var kern = (global.lang == "ja") ? 28 : 16;
49
    for (i = 1; i <= string_length(strchange); i += 1)
50
    {
51
        var ch = string_char_at(strchange, i);
52
        draw_text(_xx + 14 + (i * kern), ((_yy + 480) - 40) + 2 + (tutprog * 80), ch);
53
    }
54
    draw_set_color(c_white);
55
    draw_text(_xx + 14 + 60, ((_yy + 480) - 70) + (tutprog * 80), "/");
56
    for (i = 1; i <= string_length(strchange); i += 1)
57
    {
58
        var ch = string_char_at(strchange, i);
59
        draw_text(_xx + 14 + (i * kern), ((_yy + 480) - 40) + (tutprog * 80), ch);
60
    }
61
    draw_set_halign(fa_right);
62
    draw_set_color(#003A52);
63
    var i = string_length(strnext);
64
    while (i >= 1)
65
    {
66
        var ch = string_char_at(strnext, i);
67
        draw_text(((_xx + 640) - 200) + (i * kern), ((_yy + 480) - 70) + 2 + (tutprog * 80), ch);
68
        i -= 1;
69
    }
70
    i = string_length(strprev);
71
    while (i >= 1)
72
    {
73
        var ch = string_char_at(strprev, i);
74
        draw_text(((_xx + 640) - 264) + (i * kern), ((_yy + 480) - 40) + 2 + (tutprog * 80), ch);
75
        i -= 1;
76
    }
77
    draw_set_color(c_white);
78
    i = string_length(strnext);
79
    while (i >= 1)
80
    {
81
        var ch = string_char_at(strnext, i);
82
        draw_text(((_xx + 640) - 200) + (i * kern), ((_yy + 480) - 70) + (tutprog * 80), ch);
83
        i -= 1;
84
    }
85
    i = string_length(strprev);
86
    while (i >= 1)
87
    {
88
        var ch = string_char_at(strprev, i);
89
        draw_text(((_xx + 640) - 264) + (i * kern), ((_yy + 480) - 40) + (tutprog * 80), ch);
90
        i -= 1;
91
    }
92
    draw_set_halign(fa_left);
93
}
94
else
95
{
96
    draw_set_halign(fa_left);
97
    draw_set_color(#003A52);
98
    var kern = (global.lang == "ja") ? 28 : 16;
99
    var command_text = strup + "/" + strdown + ": ";
100
    for (i = 1; i <= string_length(command_text); i += 1)
101
    {
102
        var ch = string_char_at(command_text, i);
103
        draw_text(_xx + 14 + (i * kern), ((_yy + 480) - 70) + 2 + (tutprog * 80), ch);
104
    }
105
    for (i = 1; i <= string_length(strchange); i += 1)
106
    {
107
        var ch = string_char_at(strchange, i);
108
        draw_text(_xx + 14 + (i * kern), ((_yy + 480) - 40) + 2 + (tutprog * 80), ch);
109
    }
110
    draw_set_color(c_white);
111
    for (i = 1; i <= string_length(command_text); i += 1)
112
    {
113
        var ch = string_char_at(command_text, i);
114
        draw_text(_xx + 14 + (i * kern), ((_yy + 480) - 70) + (tutprog * 80), ch);
115
    }
116
    for (i = 1; i <= string_length(strchange); i += 1)
117
    {
118
        var ch = string_char_at(strchange, i);
119
        draw_text(_xx + 14 + (i * kern), ((_yy + 480) - 40) + (tutprog * 80), ch);
120
    }
121
    draw_set_halign(fa_right);
122
    draw_set_color(#003A52);
123
    var next_text = strbut1 + ": " + strnext;
124
    var i = string_length(next_text);
125
    while (i >= 1)
126
    {
127
        var ch = string_char_at(next_text, i);
128
        draw_text(((_xx + 640) - 280) + (i * kern), ((_yy + 480) - 70) + 2 + (tutprog * 80), ch);
129
        i -= 1;
130
    }
131
    var prev_text = strbut2 + ": " + strprev;
132
    i = string_length(prev_text);
133
    while (i >= 1)
134
    {
135
        var ch = string_char_at(prev_text, i);
136
        draw_text(((_xx + 640) - 344) + (i * kern), ((_yy + 480) - 40) + 2 + (tutprog * 80), ch);
137
        i -= 1;
138
    }
139
    draw_set_color(c_white);
140
    i = string_length(next_text);
141
    while (i >= 1)
142
    {
143
        var ch = string_char_at(next_text, i);
144
        draw_text(((_xx + 640) - 280) + (i * kern), ((_yy + 480) - 70) + (tutprog * 80), ch);
145
        i -= 1;
146
    }
147
    i = string_length(prev_text);
148
    while (i >= 1)
149
    {
150
        var ch = string_char_at(prev_text, i);
151
        draw_text(((_xx + 640) - 344) + (i * kern), ((_yy + 480) - 40) + (tutprog * 80), ch);
152
        i -= 1;
153
    }
154
    draw_set_halign(fa_left);
155
}