Undertale Yellow script viewer

← back to main script listing

gml_GlobalScript_scr_draw_text_effect_shaky_textbox_battle

(view raw script w/o annotations or w/e)
1
function scr_draw_text_effect_shaky_textbox_battle
scr_draw_text_effect_shaky_textbox_battle

function scr_draw_text_effect_shaky_textbox_battle() //gml_Script_scr_draw_text_effect_shaky_textbox_battle { var shaky_text_intensity = global.shaky_text_intensity str_indent = "" str_indent_count = 0 str_offset = (-(string_width(string_hash_to_newline(string_copy("A", 1, 1))))) for (var i = 1; i <= characters; i += 1) { str_char = string_char_at(message[message_current], i) if (str_char == "#") { str_indent_count += 1 if (str_indent_count == 1) str_indent = "#" else if (str_indent_count == 2) str_indent = "##" str_offset = (-(string_width(string_hash_to_newline(string_copy("A", 1, 1))))) * 2 } str_offset += string_width(string_hash_to_newline(string_copy("A", 1, 1))) if (string_lettersdigits(str_char) == "") draw_text((obj_dialogue_box_battle.x + 20 + str_offset), (obj_dialogue_box_battle.y + 20), string_hash_to_newline(str_indent + str_char)) else draw_text((obj_dialogue_box_battle.x + 20 + str_offset + (irandom_range(-1, 1)) * shaky_text_intensity), (obj_dialogue_box_battle.y + 20 + (irandom_range(-1, 1)) * shaky_text_intensity), string_hash_to_newline(str_indent + str_char)) } }
() //gml_Script_scr_draw_text_effect_shaky_textbox_battle
2
{
3
    var shaky_text_intensity = global.shaky_text_intensity
4
    str_indent = ""
5
    str_indent_count = 0
6
    str_offset = (-(string_width(string_hash_to_newline(string_copy("A", 1, 1)))))
7
    for (var i = 1; i <= characters; i += 1)
8
    {
9
        str_char = string_char_at(message[message_current], i)
10
        if (str_char == "#")
11
        {
12
            str_indent_count += 1
13
            if (str_indent_count == 1)
14
                str_indent = "#"
15
            else if (str_indent_count == 2)
16
                str_indent = "##"
17
            str_offset = (-(string_width(string_hash_to_newline(string_copy("A", 1, 1))))) * 2
18
        }
19
        str_offset += string_width(string_hash_to_newline(string_copy("A", 1, 1)))
20
        if (string_lettersdigits(str_char) == "")
21
            draw_text((obj_dialogue_box_battle.x + 20 + str_offset), (obj_dialogue_box_battle.y + 20), string_hash_to_newline(str_indent + str_char))
22
        else
23
            draw_text((obj_dialogue_box_battle.x + 20 + str_offset + (irandom_range(-1, 1)) * shaky_text_intensity), (obj_dialogue_box_battle.y + 20 + (irandom_range(-1, 1)) * shaky_text_intensity), string_hash_to_newline(str_indent + str_char))
24
    }
25
}