Undertale script viewer

← back to main script listing

gml_Object_obj_base_writer_Draw_0

(view raw script w/o annotations or w/e)
1
if (vtext)
2
    myx = writingxend - vspacing;
3
else
4
    myx = writingx;
5
myy = writingy;
6
var halfsize = 0;
7
for (var n = 1; n <= stringpos; n++)
8
{
9
    var ch = string_char_at(originalstring, n);
10
    var myletter = "";
11
    if (ch == "^" && string_char_at(originalstring, n + 1) != "0")
12
    {
13
        n++;
14
    }
15
    else if (ch == "\")
16
    {
17
        n++;
18
        ch = string_char_at(originalstring, n);
19
        if (ch == "R")
20
        {
21
            mycolor = 255;
22
        }
23
        else if (ch == "G")
24
        {
25
            mycolor = 65280;
26
        }
27
        else if (ch == "W")
28
        {
29
            mycolor = 16777215;
30
        }
31
        else if (ch == "Y")
32
        {
33
            mycolor = 65535;
34
        }
35
        else if (ch == "X")
36
        {
37
            mycolor = 0;
38
        }
39
        else if (ch == "B")
40
        {
41
            mycolor = 16711680;
42
        }
43
        else if (ch == "O")
44
        {
45
            mycolor = 4235519;
46
        }
47
        else if (ch == "L")
48
        {
49
            mycolor = 16629774;
50
        }
51
        else if (ch == "P")
52
        {
53
            mycolor = 16711935;
54
        }
55
        else if (ch == "p")
56
        {
57
            mycolor = 13941759;
58
        }
59
        else if (ch == "C")
60
        {
61
            event_user(1);
62
        }
63
        else if (ch == "M")
64
        {
65
            n++;
66
            ch = string_char_at(originalstring, n);
67
            global.flag[20 animation_index] = real(ch);
68
        }
69
        else if (ch == "E")
70
        {
71
            n++;
72
            ch = string_char_at(originalstring, n);
73
            global.faceemotion = real(ch);
74
        }
75
        else if (ch == "F")
76
        {
77
            n++;
78
            ch = string_char_at(originalstring, n);
79
            global.facechoice = real(ch);
80
            global.facechange = 1;
81
        }
82
        else if (ch == "S")
83
        {
84
            n++;
85
        }
86
        else if (ch == "T")
87
        {
88
            n++;
89
            var newtyper = string_char_at(originalstring, n);
90
            if (newtyper == "-")
91
            {
92
                halfsize = 1;
93
            }
94
            else if (newtyper == "+")
95
            {
96
                halfsize = 0;
97
            }
98
            else
99
            {
100
                if (newtyper == "T")
101
                    global.typer = 4;
102
                if (newtyper == "t")
103
                    global.typer = 48;
104
                if (newtyper == "0")
105
                    global.typer = 5;
106
                if (newtyper == "S")
107
                    global.typer = 10;
108
                if (newtyper == "F")
109
                    global.typer = 16;
110
                if (newtyper == "s")
111
                    global.typer = 17;
112
                if (newtyper == "P")
113
                    global.typer = 18;
114
                if (newtyper == "M")
115
                    global.typer = 27;
116
                if (newtyper == "U")
117
                    global.typer = 37;
118
                if (newtyper == "A")
119
                    global.typer = 47;
120
                if (newtyper == "a")
121
                    global.typer = 60;
122
                if (newtyper == "R")
123
                    global.typer = 76;
124
                SCR_TEXTTYPE
SCR_TEXTTYPE

if (argument0 != 0) global.typer = argument0; if (global.typer == 1) script_execute(SCR_TEXTSETUP, fnt_main, c_white, x + 20, y + 20, x + (global.idealborder[1] - 55), 1, 1, SND_TXT2, 16, 32); if (global.typer == 2) script_execute(SCR_TEXTSETUP, fnt_plain, c_black, x, y, x + 190, 43, 2, SND_TXT1, 9, 20); if (global.typer == 3) script_execute(SCR_TEXTSETUP, fnt_curs, c_teal, x, y, x + 100, 39, 3, SND_TXT1, 10, 10); if (global.typer == 4) script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 1, snd_txttor, 8, 18); if (global.typer == 5) script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 1, SND_TXT1, 8, 18); if (global.typer == 6) script_execute(SCR_TEXTSETUP, fnt_plain, c_black, x, y, x + 200, 0, 1, snd_floweytalk1, 9, 20); if (global.typer == 7) script_execute(SCR_TEXTSETUP, fnt_plain, c_black, x, y, x + 200, 2, 2, snd_floweytalk2, 9, 20); if (global.typer == 8) script_execute(SCR_TEXTSETUP, fnt_plain, c_black, x, y, x + 200, 0, 1, snd_txttor, 9, 20); if (global.typer == 9) script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 1, snd_floweytalk1, 8, 18); if (global.typer == 10) script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 1, snd_nosound, 8, 18); if (global.typer == 11) script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 2, SND_TXT2, 9, 18); if (global.typer == 12) script_execute(SCR_TEXTSETUP, fnt_plain, c_black, x, y, x + 200, 1, 3, snd_txttor2, 10, 20); if (global.typer == 13) script_execute(SCR_TEXTSETUP, fnt_plain, c_black, x, y, x + 200, 2, 4, snd_txttor2, 11, 20); if (global.typer == 14) script_execute(SCR_TEXTSETUP, fnt_plain, c_black, x, y, x + 200, 3, 5, snd_txttor2, 14, 20); if (global.typer == 15) script_execute(SCR_TEXTSETUP, fnt_plain, c_black, x, y, x + 200, 0, 10, snd_txttor2, 18, 20); if (global.typer == 16) script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, view_xview[view_current] + 290, 1.2, 2, snd_floweytalk2, 8, 18); if (global.typer == 17) script_execute(SCR_TEXTSETUP, fnt_comicsans, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 1, snd_txtsans, 8, 18); if (global.typer == 19) global.typer = 18; if (global.typer == 18) script_execute(SCR_TEXTSETUP, fnt_papyrus, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 1, snd_txtpap, 11, 18); if (global.typer == 20) script_execute(SCR_TEXTSETUP, fnt_plainbig, c_black, x, y, x + 200, 0, 2, snd_floweytalk2, 25, 20); if (global.typer == 21) script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 4, snd_nosound, 10, 18); if (global.typer == 22) script_execute(SCR_TEXTSETUP, fnt_papyrus, c_black, x + 10, y, x + 200, 1, 1, snd_txtpap, 11, 20); if (global.typer == 23) script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, view_xview[view_current] + 310, 0, 1, SND_TXT1, 8, 18); if (global.typer == 24) script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, view_xview[view_current] + 310, 0, 1, snd_tem, 8, 18); if (global.typer == 25) { if (global.language == "ja") script_execute(SCR_TEXTSETUP, fnt_ja_plainsmall, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 1, SND_TXT1, 10, 15); else script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 1, SND_TXT1, 8, 18); } if (global.typer == 27) script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 3, snd_mtt1, 8, 18); if (global.typer == 28) script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 2, snd_tem, 8, 18); if (global.typer == 30) script_execute(SCR_TEXTSETUP, fnt_main, c_white, x + 20, y + 20, 9999, 0, 2, snd_txtasg, 20, 36); if (global.typer == 31) script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, 9999, 0, 2, snd_txtasg, 12, 18); if (global.typer == 32) script_execute(SCR_TEXTSETUP, fnt_main, c_white, x + 20, y + 20, 9999, 0, 2, snd_txtasr, 20, 36); if (global.typer == 33) script_execute(SCR_TEXTSETUP, fnt_plain, c_black, x, y, x + 190, 43, 1, SND_TXT1, 9, 20); if (global.typer == 34) script_execute(SCR_TEXTSETUP, fnt_wingdings, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 3, snd_wngdng1, 16, 18); if (global.typer == 35) script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 2, snd_txtasr, 10, 18); if (global.typer == 36) script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 8, snd_txtasr2, 10, 18); if (global.typer == 37) script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 1, snd_txtund, 8, 18); if (global.typer == 38) script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 6, snd_txtund, 8, 18); if (global.typer == 39) script_execute(SCR_TEXTSETUP, fnt_plain, c_black, x + 16, y, x + 190, 0, 1, snd_txtund, 9, 20); if (global.typer == 40) script_execute(SCR_TEXTSETUP, fnt_plain, c_black, x + 16, y, x + 190, 1, 2, snd_txtund, 9, 20); if (global.typer == 41) script_execute(SCR_TEXTSETUP, fnt_plain, c_black, x + 16, y, x + 190, 0, 1, snd_txtund, 9, 20); if (global.typer == 42) script_execute(SCR_TEXTSETUP, fnt_plain, c_black, x + 16, y, x + 190, 2, 4, snd_txtund, 9, 20); if (global.typer == 43) script_execute(SCR_TEXTSETUP, fnt_plain, c_black, x + 16, y, x + 190, 2, 4, snd_txtund2, 9, 20); if (global.typer == 44) script_execute(SCR_TEXTSETUP, fnt_plain, c_black, x + 16, y, x + 190, 2, 5, snd_txtund3, 9, 20); if (global.typer == 45) script_execute(SCR_TEXTSETUP, fnt_plain, c_black, x + 16, y, x + 190, 2, 7, snd_txtund4, 9, 20); if (global.typer == 47) script_execute(SCR_TEXTSETUP, fnt_maintext, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 1, snd_txtal, 8, 18); if (global.typer == 48) script_execute(SCR_TEXTSETUP, fnt_comicsans, c_white, x + 20, y + 20, view_xview[view_current] + 290, 0, 1, snd_txtsans2, 8, 18); if (global.typer == 49) script_execute(SCR_TEXTSETUP, fnt_plain, c_white, x, y, x + 190, 43, 1, snd_txtal, 9, 20); if (global.typer == 50) script_execute(SCR_TEXTSETUP, fnt_main, c_white, x + 20, y + 10, 999, 0, 3, snd_mtt1, 8, 18); ...
(global.typer);
125
                global.facechange = 1;
126
            }
127
        }
128
        else if (ch == "z")
129
        {
130
            n++;
131
            var sym = real(string_char_at(originalstring, n));
132
            if (sym == 4)
133
            {
134
                var sym_s = 862;
135
                draw_sprite_ext(sym_s, 0, myx + (random(shake) - (shake / 2)), myy + 10 + (random(shake) - (shake / 2)), 2, 2, 0, c_white, 1);
136
            }
137
        }
138
        else if (ch == "*")
139
        {
140
            n++;
141
            ch = string_char_at(originalstring, n);
142
            var icontype = 0;
143
            if (myfont == fnt_papyrus || myfont == fnt_ja_papyrus_btl)
144
                icontype = 1;
145
            var sprite = scr_getbuttonsprite
scr_getbuttonsprite

var control = argument0; var type = argument1; if (control == "A") { if (os_type == os_ps4) return button_ps4_dpad_l; if (os_type == os_psvita) return button_vita_dpad_l; return noone; } if (control == "D") { if (os_type == os_ps4) return button_ps4_dpad_r; if (os_type == os_psvita) return button_vita_dpad_r; return noone; } var button = -4; if (control == "Z") button = global.button0; if (control == "X") button = global.button1; if (control == "C") button = global.button2; if (button == gp_face1) { if (os_type == os_ps4) { if (type == 1) return buttonL_ps4_cross; return button_ps4_cross; } if (os_type == os_psvita) { if (type == 1) return buttonL_vita_cross; return button_vita_cross; } } if (button == gp_face2) { if (os_type == os_ps4) { if (type == 1) return buttonL_ps4_circle; return button_ps4_circle; } if (os_type == os_psvita) { if (type == 1) return buttonL_vita_circle; return button_vita_circle; } } if (button == gp_face3) { if (os_type == os_ps4) { if (type == 1) return buttonL_ps4_square; return button_ps4_square; } if (os_type == os_psvita) { if (type == 1) return buttonL_vita_square; return button_vita_square; } } if (button == gp_face4) { if (os_type == os_ps4) { if (type == 1) return buttonL_ps4_triangle; return button_ps4_triangle; } if (os_type == os_psvita) { if (type == 1) return buttonL_vita_triangle; return button_vita_triangle; } } if (button == gp_shoulderl) { if (os_type == os_ps4) { if (type == 1) return buttonL_ps4_l1; return button_ps4_l1; } if (os_type == os_psvita) { if (type == 1) return buttonL_vita_l; return button_vita_l; } } if (button == gp_shoulderlb) ...
(ch, icontype);
146
            if (sprite != -4)
147
            {
148
                var spritex = myx;
149
                var spritey = myy;
150
                if (shake > 38)
151
                {
152
                    if (shake == 39)
153
                    {
154
                        direction += 10;
155
                        spritex += hspeed;
156
                        spritey += vspeed;
157
                    }
158
                    else if (shake == 40)
159
                    {
160
                        spritex += hspeed;
161
                        spritey += vspeed;
162
                    }
163
                    else if (shake == 41)
164
                    {
165
                        direction += (10 * n);
166
                        spritex += hspeed;
167
                        spritey += vspeed;
168
                        direction -= (10 * n);
169
                    }
170
                    else if (shake == 42)
171
                    {
172
                        direction += (20 * n);
173
                        spritex += hspeed;
174
                        spritey += vspeed;
175
                        direction -= (20 * n);
176
                    }
177
                    else if (shake == 43)
178
                    {
179
                        direction += (30 * n);
180
                        spritex += ((hspeed * 0.7) + 10);
181
                        spritey += (vspeed * 0.7);
182
                        direction -= (30 * n);
183
                    }
184
                }
185
                else if (!instance_exists(obj_papdate))
186
                {
187
                    spritex += (random(shake) - (shake / 2));
188
                    spritey += (random(shake) - (shake / 2));
189
                }
190
                var icon_scale = 1;
191
                if (myfont == fnt_main || myfont == fnt_ja_main)
192
                    icon_scale = 2;
193
                if (myfont == fnt_main || myfont == fnt_maintext)
194
                    spritey += (1 * icon_scale);
195
                if (myfont == fnt_ja_papyrus_btl)
196
                    spritex -= 1;
197
                if (myfont == fnt_papyrus && icontype == 1)
198
                    spritey += floor((16 - sprite_get_height(sprite)) / 2);
199
                if (vtext)
200
                {
201
                    draw_sprite_ext(sprite, 0, spritex - sprite_get_width(sprite), spritey, icon_scale, icon_scale, 0, c_white, 1);
202
                    myy += ((sprite_get_height(sprite) + 1) * icon_scale);
203
                }
204
                else
205
                {
206
                    draw_sprite_ext(sprite, 0, spritex, spritey, icon_scale, icon_scale, 0, c_white, 1);
207
                    myx += ((sprite_get_width(sprite) + 1) * icon_scale);
208
                }
209
            }
210
        }
211
        else if (ch == ">")
212
        {
213
            n++;
214
            var choiceindex = real(string_char_at(originalstring, n));
215
            if (choiceindex == 1)
216
            {
217
                myx = 196;
218
            }
219
            else
220
            {
221
                myx = 100;
222
                if (myfont == fnt_ja_comicsans_big)
223
                    myx += 11;
224
            }
225
            if (view_wview[view_current] == 640)
226
                myx *= 2;
227
            myx += view_xview[view_current];
228
        }
229
    }
230
    else if (ch == "&")
231
    {
232
        script_execute(SCR_NEWLINE);
233
    }
234
    else if (ch == "/")
235
    {
236
        halt = 1;
237
        var nextch = string_char_at(originalstring, n + 1);
238
        if (nextch == "%")
239
            halt = 2;
240
        else if (nextch == "^" && string_char_at(originalstring, n + 2) != "0")
241
            halt = 4;
242
        else if (nextch == "*")
243
            halt = 6;
244
        break;
245
    }
246
    else if (ch == "%")
247
    {
248
        if (string_char_at(originalstring, n + 1) == "%")
249
        {
250
            instance_destroy();
251
            break;
252
        }
253
        stringno++;
254
        originalstring = scr_replace_buttons_pc
scr_replace_buttons_pc

var str = argument0; if (global.osflavor <= 2) { str = string_replace_all(str, "\*Z", "[Z]"); str = string_replace_all(str, "\*X", "[X]"); str = string_replace_all(str, "\*C", "[C]"); str = string_replace_all(str, "\*A",
[LEFT]
scr_gettext("key_left")
); str = string_replace_all(str, "\*D",
[RIGHT]
scr_gettext("key_right")
); } return str;
(mystring[stringno]);
255
        stringpos = 0;
256
        myx = writingx;
257
        myy = writingy;
258
        alarm[0] = textspeed;
gml_Object_obj_base_writer_Alarm_0.gml

if (stringpos >= string_length(originalstring)) exit; var advance = 1; if (global.typer == 111) advance += 1; if (txtsound == 56) advance += 2; else if (txtsound == 65) advance += 1; var dosound = 0; var delay = textspeed; while (stringpos < string_length(originalstring) && advance > 0) { stringpos++; var ch = string_char_at(originalstring, stringpos); if (ch == "^") { stringpos++; ch = string_char_at(originalstring, stringpos); if (ch != "0") { var n = real(ch); delay = n * 10; advance = 1; } } else if (ch == "\") { stringpos++; ch = string_char_at(originalstring, stringpos); if (ch == "S") { stringpos++; var sfxtype = string_char_at(originalstring, stringpos); if (sfxtype == "+") { sound_enable = 1; } else if (sfxtype == "-") { sound_enable = 0; } else { var sfx = -4; if (sfxtype == "p") sfx = 105; if (sfx != -4) snd_play(sfx); } } else if (ch == "z") { stringpos++; advance--; if (sound_enable) dosound = 1; } else if (ch == "E" || ch == "F" || ch == "M" || ch == "T" || ch == "*") { stringpos++; } } else if (ch != "/" && ch != "%" && ch != "&") { advance--; if (sound_enable) dosound = 1; } } alarm[0] = delay; if (dosound) { if (txtsound == 56) { snd_stop(snd_mtt1); snd_stop(snd_mtt2); snd_stop(snd_mtt3); snd_stop(snd_mtt4); snd_stop(snd_mtt5); snd_stop(snd_mtt6); snd_stop(snd_mtt7); snd_stop(snd_mtt8); snd_stop(snd_mtt9); var rnsound = floor(random(9)); switch (rnsound) { case 0: snd_play(snd_mtt1); break; case 1: snd_play(snd_mtt2); break; case 2: snd_play(snd_mtt3); break; case 3: snd_play(snd_mtt4); break; case 4: snd_play(snd_mtt5); ...
259
        break;
260
    }
261
    else
262
    {
263
        myletter = string_char_at(originalstring, n);
264
        if (myletter == "^")
265
            n++;
266
        if (!vtext && myx > writingxend)
267
            script_execute(SCR_NEWLINE);
268
        var letterx = myx;
269
        var offsetx = 0;
270
        var offsety = 0;
271
        var halfscale = 1;
272
        if (halfsize)
273
        {
274
            halfscale = 0.5;
275
            if (vtext)
276
                offsetx += (vspacing * 0.33);
277
            else
278
                offsety += (vspacing * 0.33);
279
        }
280
        if (global.language == "en")
281
        {
282
            if (global.typer == 18)
283
            {
284
                if (myletter == "l" || myletter == "i")
285
                    letterx += 2;
286
                if (myletter == "I")
287
                    letterx += 2;
288
                if (myletter == "!")
289
                    letterx += 2;
290
                if (myletter == ".")
291
                    letterx += 2;
292
                if (myletter == "S")
293
                    letterx += 1;
294
                if (myletter == "?")
295
                    letterx += 2;
296
                if (myletter == "D")
297
                    letterx += 1;
298
                if (myletter == "A")
299
                    letterx += 1;
300
                if (myletter == "'")
301
                    letterx += 1;
302
            }
303
        }
304
        else if (global.language == "ja")
305
        {
306
            if (vtext && (myfont == fnt_ja_papyrus || myfont == fnt_ja_papyrus_btl))
307
            {
308
                if (myy == writingy && (myletter == "「" || myletter == "『"))
309
                    myy -= round((string_width(myletter) / 2) * htextscale * halfscale);
310
            }
311
            else if (myfont == fnt_ja_maintext || myfont == fnt_ja_main)
312
            {
313
                var unit = htextscale * halfscale;
314
                if (myfont == fnt_ja_main)
315
                    unit *= 2;
316
                if (ord(myletter) < 1024 || ord(myletter) == 8211)
317
                {
318
                    if (n > 1)
319
                    {
320
                        var lastch = ord(string_char_at(originalstring, n - 1));
321
                        if (lastch >= 1024 && lastch < 65281 && lastch != 8211 && lastch != 12288)
322
                            letterx += unit;
323
                    }
324
                }
325
            }
326
        }
327
        scr_setfont
scr_setfont

var newfont = argument0; if (global.language == "ja") { if (newfont == fnt_main) newfont = fnt_ja_main; if (newfont == fnt_maintext) newfont = fnt_ja_maintext; if (newfont == fnt_plain) newfont = fnt_ja_plain; } draw_set_font(newfont);
(myfont);
328
        draw_set_color(mycolor);
329
        var angle;
330
        if (vtext)
331
            angle = -90;
332
        else
333
            angle = 0;
334
        if (shake > 38)
335
        {
336
            if (shake == 39)
337
            {
338
                direction += 10;
339
                offsetx += hspeed;
340
                offsety += vspeed;
341
            }
342
            else if (shake == 40)
343
            {
344
                offsetx += hspeed;
345
                offsety += vspeed;
346
            }
347
            else if (shake == 41)
348
            {
349
                direction += (10 * n);
350
                offsetx += hspeed;
351
                offsety += vspeed;
352
                direction -= (10 * n);
353
            }
354
            else if (shake == 42)
355
            {
356
                direction += (20 * n);
357
                offsetx += hspeed;
358
                offsety += vspeed;
359
                direction -= (20 * n);
360
            }
361
            else if (shake == 43)
362
            {
363
                direction += (30 * n);
364
                offsetx += ((hspeed * 0.7) + 10);
365
                offsety += (vspeed * 0.7);
366
                direction -= (30 * n);
367
            }
368
        }
369
        else
370
        {
371
            offsetx += (random(shake) - (shake / 2));
372
            offsety += (random(shake) - (shake / 2));
373
        }
374
        var display_scale = surface_get_width(application_surface) / view_wview[view_current];
375
        var finalx = round((letterx + offsetx) * display_scale) / display_scale;
376
        var finaly = round((myy + offsety) * display_scale) / display_scale;
377
        draw_text_transformed(finalx, finaly, myletter, htextscale * halfscale, vtextscale * halfscale, angle);
378
        letterx += spacing;
379
        if (global.language == "en")
380
        {
381
            if (myfont == fnt_comicsans)
382
            {
383
                if (myletter == "w")
384
                    letterx += 2;
385
                if (myletter == "m")
386
                    letterx += 2;
387
                if (myletter == "i")
388
                    letterx -= 2;
389
                if (myletter == "l")
390
                    letterx -= 2;
391
                if (myletter == "s")
392
                    letterx -= 1;
393
                if (myletter == "j")
394
                    letterx -= 1;
395
            }
396
            else if (myfont == fnt_papyrus)
397
            {
398
                if (myletter == "D")
399
                    letterx += 1;
400
                if (myletter == "Q")
401
                    letterx += 3;
402
                if (myletter == "M")
403
                    letterx += 1;
404
                if (myletter == "L")
405
                    letterx -= 1;
406
                if (myletter == "K")
407
                    letterx -= 1;
408
                if (myletter == "C")
409
                    letterx += 1;
410
                if (myletter == ".")
411
                    letterx -= 3;
412
                if (myletter == "!")
413
                    letterx -= 3;
414
                if (myletter == "O" || myletter == "W")
415
                    letterx += 2;
416
                if (myletter == "I")
417
                    letterx -= 6;
418
                if (myletter == "T")
419
                    letterx -= 1;
420
                if (myletter == "P")
421
                    letterx -= 2;
422
                if (myletter == "R")
423
                    letterx -= 2;
424
                if (myletter == "A")
425
                    letterx += 1;
426
                if (myletter == "H")
427
                    letterx += 1;
428
                if (myletter == "B")
429
                    letterx += 1;
430
                if (myletter == "G")
431
                    letterx += 1;
432
                if (myletter == "F")
433
                    letterx -= 1;
434
                if (myletter == "?")
435
                    letterx -= 3;
436
                if (myletter == "'")
437
                    letterx -= 6;
438
                if (myletter == "J")
439
                    letterx -= 1;
440
            }
441
        }
442
        else if (global.language == "ja")
443
        {
444
            if (vtext)
445
            {
446
                myy += round(string_width(myletter) * htextscale * halfscale);
447
            }
448
            else if (myletter == " " || ord(myletter) >= 65377)
449
            {
450
                letterx -= floor(spacing / 2);
451
            }
452
            else if (ord(myletter) < 1024 || ord(myletter) == 8211)
453
            {
454
                if (myfont == fnt_ja_comicsans || myfont == fnt_ja_comicsans_big)
455
                    letterx -= floor(spacing * 0.3);
456
                else
457
                    letterx -= floor(spacing * 0.4);
458
            }
459
        }
460
        if (!vtext)
461
        {
462
            if (halfsize)
463
                myx = round(myx + ((letterx - myx) / 2));
464
            else
465
                myx = letterx;
466
        }
467
    }
468
}