alright fixed. argument1 is now the name of your face sprite. Each face sprite should have an open or closed mouth, with the second subimage being an open mouth, & you'll need a different sprite for each expression.
ti = argument0; //Input text
to = ''; //Output text
tn = 0; //Text at
c = !argument2; //color modifier
face = argument1; //face sprite.
//Give each expression its own mouth open & closed for vowels.
//Open mouth should be the second subimage
io_clear(); //clears the pressed status any previously pressed buttons & input devices for this step
if argument3 = false //If you are not in "Cutscene" mode
{
draw_background(back_TextBox,0,480-128) //Draws the text box.
//You can make this your own background
}
else //if you are in 'Cutscene' mode
{
draw_set_color(make_color_rgb(255*!c,255*!c,255*!c)) //makes the color black or white
draw_rectangle(0,480-128,640,480,false) //Draws the "text box"
}
while string_length(to) < string_length(ti)
{
tn += 1; //Sets the point where the text is at
if sprite_exists(face) //if you have a face sprite.
{
if string_char_at(ti,tn)= 'A' //if there is a vowel at the current piece of text
||string_char_at(ti,tn) = 'E'
||string_char_at(ti,tn) = 'I'
||string_char_at(ti,tn) = 'O'
||string_char_at(ti,tn) = 'U'
||string_char_at(ti,tn) = 'Y'
||string_char_at(ti,tn) = 'a'
||string_char_at(ti,tn) = 'e'
||string_char_at(ti,tn) = 'i'
||string_char_at(ti,tn) = 'o'
||string_char_at(ti,tn) = 'y'
{
f=1; //mouth will be open
}
else f=0; //mouth is closed
draw_sprite(face,f,8,480-123)
}
draw_set_font(fnt_Text) //Sets the font to your Text font
draw_set_valign(fa_top) //Aligns the font
draw_set_color(make_color_rgb(255*c,255*c,255*c)); //makes the text color
to = string_copy(ti,0,tn); //Makes the output string
draw_text_ext(50+8,480-123,to,15,-1); //Draws the text
screen_refresh(); //Refreshes the screen (so the text will appear)
sleep(50); //Waits 25 milliseconds before iterating
}
draw_set_color(c_aqua) //sets the color to light blue
draw_triangle(640-2,480-20,640-20,480-20,640-12,480-2,false) //draws a triangle
screen_refresh(); //Refreshes the screen
while !keyboard_check(vk_enter) //Until the Enter key is pressed
{
sleep(1); //Waits 1 millisecond
}
screen_redraw(); //redraws the screen, stopping certain graphical glitches
basically:
scr_DrawText('Your Text belongs right here', spr_FaceSprite, false, false)
argument0 is your string,
argument1 is your face sprite (use a sprites name for a faceplate of that sprite, or use false or '' for no sprite)
argument2 is text color (false for white, true for black)
argument3 is 'cutscene mode' (no textbox, white or black back inverse to text color)