1 |
function scr_draw_text_effect_twitchy_quotebubble_battle_2scr_draw_text_effect_twitchy_quotebubble_battle_2function scr_draw_text_effect_twitchy_quotebubble_battle_2() //gml_Script_scr_draw_text_effect_twitchy_quotebubble_battle_2
{
var twitchy_text_probability = global.twitchy_text_probability
var twitchy_text_intensity = global.twitchy_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)
{
twitchy_text_offset_x = 0
twitchy_text_offset_y = 0
twitchy_text_number = irandom_range(1, twitchy_text_probability)
if (twitchy_text_number == twitchy_text_probability)
{
twitch_direction = irandom_range(1, 4)
switch twitch_direction
{
case 1:
twitchy_text_offset_x = 1
twitchy_text_offset_y = 0
break
case 2:
twitchy_text_offset_x = -1
twitchy_text_offset_y = 0
break
case 3:
twitchy_text_offset_x = 0
twitchy_text_offset_y = 1
break
case 4:
twitchy_text_offset_x = 0
twitchy_text_offset_y = -1
break
}
}
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 = "##"
else if (str_indent_count == 3)
str_indent = "###"
else if (str_indent_count == 4)
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_quote_bubble_battle_2.x + 21 + str_offset), (obj_quote_bubble_battle_2.y + 9), string_hash_to_newline(str_indent + str_char))
else
draw_text((obj_quote_bubble_battle_2.x + 21 + str_offset + twitchy_text_offset_x * twitchy_text_intensity), (obj_quote_bubble_battle_2.y + 9 + twitchy_text_offset_y * twitchy_text_intensity), string_hash_to_newline(str_indent + str_char))
}
} () //gml_Script_scr_draw_text_effect_twitchy_quotebubble_battle_2 |
2 |
{ |
3 |
var twitchy_text_probability = global.twitchy_text_probability |
4 |
var twitchy_text_intensity = global.twitchy_text_intensity |
5 |
str_indent = "" |
6 |
str_indent_count = 0 |
7 |
str_offset = (-(string_width(string_hash_to_newline(string_copy("A", 1, 1))))) |
8 |
for (var i = 1; i <= characters; i += 1) |
9 |
{ |
10 |
twitchy_text_offset_x = 0 |
11 |
twitchy_text_offset_y = 0 |
12 |
twitchy_text_number = irandom_range(1, twitchy_text_probability) |
13 |
if (twitchy_text_number == twitchy_text_probability) |
14 |
{ |
15 |
twitch_direction = irandom_range(1, 4) |
16 |
switch twitch_direction |
17 |
{ |
18 |
case 1: |
19 |
twitchy_text_offset_x = 1 |
20 |
twitchy_text_offset_y = 0 |
21 |
break |
22 |
case 2: |
23 |
twitchy_text_offset_x = -1 |
24 |
twitchy_text_offset_y = 0 |
25 |
break |
26 |
case 3: |
27 |
twitchy_text_offset_x = 0 |
28 |
twitchy_text_offset_y = 1 |
29 |
break |
30 |
case 4: |
31 |
twitchy_text_offset_x = 0 |
32 |
twitchy_text_offset_y = -1 |
33 |
break |
34 |
} |
35 |
|
36 |
} |
37 |
str_char = string_char_at(message[message_current], i) |
38 |
if (str_char == "#") |
39 |
{ |
40 |
str_indent_count += 1 |
41 |
if (str_indent_count == 1) |
42 |
str_indent = "#" |
43 |
else if (str_indent_count == 2) |
44 |
str_indent = "##" |
45 |
else if (str_indent_count == 3) |
46 |
str_indent = "###" |
47 |
else if (str_indent_count == 4) |
48 |
str_indent = "####" |
49 |
str_offset = (-(string_width(string_hash_to_newline(string_copy("A", 1, 1))))) * 2 |
50 |
} |
51 |
str_offset += string_width(string_hash_to_newline(string_copy("A", 1, 1))) |
52 |
if (string_lettersdigits(str_char) == "") |
53 |
draw_text((obj_quote_bubble_battle_2.x + 21 + str_offset), (obj_quote_bubble_battle_2.y + 9), string_hash_to_newline(str_indent + str_char)) |
54 |
else |
55 |
draw_text((obj_quote_bubble_battle_2.x + 21 + str_offset + twitchy_text_offset_x * twitchy_text_intensity), (obj_quote_bubble_battle_2.y + 9 + twitchy_text_offset_y * twitchy_text_intensity), string_hash_to_newline(str_indent + str_char)) |
56 |
} |
57 |
} |