Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // CREATE EVENT:
- message[0] = "...Sorry, Kid. You can't get in unless you get vouched for.";
- message[1] = "TEST TEST";
- message_current = 0;
- timer = 0;
- cutoff = 0;
- t = 0;
- increment = 1;
- done = false;
- -----
- // DRAW GUI EVENT:
- draw_set_font(f_dialogue);
- draw_set_colour(c_white);
- draw_set_halign(fa_center);
- message_end = array_length_1d(message);
- if (message_end > 0)
- {
- var charWidth = 30;
- var lineEnd = 55;
- var line = 0;
- var space = 0;
- var i = 1;
- var delay = 3;
- tX = (room_width / 2.0);
- tY = view_hview[0]-730;
- if (keyboard_check_pressed(vk_enter))
- {
- if (message_current < message_end-1)
- {
- message_current++;
- cutoff = 0;
- }
- else
- {
- done = true;
- }
- }
- if (cutoff < string_length(message[message_current]))
- {
- if (timer >= delay)
- {
- cutoff++;
- timer = 0;
- }
- else timer++;
- }
- while(i <= string_length(message[message_current]) && i <= cutoff)
- {
- var length = 0;
- while (string_char_at(message[message_current], i) != " " && i <= string_length(message[message_current]))
- {
- i++;
- length++;
- }
- if (space+length > lineEnd)
- {
- space = 0;
- line++;
- }
- i-= length;
- draw_text(tX+(space*charWidth), tY+(50*line), string_char_at(message[message_current], i));
- space++;
- i++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement