so, here is the original code, the arguments are (x,y,message,speed)
var newtext,text,xx,yy,replace,line,font,back;
font = spr_Font
xx = 10;
yy = 16;
line = 0;
text = argument2
i=0
draw_sprite(spr_Textbox,-1,argument0,argument1+8)
while i<string_length(argument2)
{
i+=1
newtext = string_copy(text,i,1)
if newtext = " "
{
replace=string_copy(text,i+1,string_length(text)-i)+' '
replace=string_replace_all(replace,'^','')
replace=string_replace_all(replace,'%','')
replace=string_replace_all(replace,'*','')
replace=string_pos(' ',replace)-1
if xx+8*replace>(sprite_get_width(spr_Textbox)-16)
{
line+=1
xx = 2;
yy+=16;
}
}
if line=3
{
line = 0
keyboard_wait()
xx = 2
yy = 16
screen_redraw()
draw_sprite(spr_Textbox,-1,argument0+8,argument1+8)
}
switch newtext
{
case "^": // "^" = red
font = spr_RFont
continue;
break;
case "%": // "%" = blue
font = spr_BFont
continue;
break;
case "*": // "*" = green
font = spr_GFont
continue;
break;
case " ": // def colour
font = spr_Font
}
xx+=8
str = string_to_number(newtext)
draw_sprite(font,str,argument0+xx,argument1+yy)
screen_refresh()
sleep(((100-(60*keyboard_check(vk_space))))/argument3)
if i=string_length(text)
break;
}
if newtext!=""
{
sound_play(text_finish)
draw_sprite(spr_Textmore,-1,argument0+(sprite_get_width(spr_Textbox)/1.1),argument1+(sprite_get_height(spr_Textbox)+2))
screen_refresh()
keyboard_wait()
}
else
draw_text_scrolling(argument0,argument1,argument2,argument3)
My version of this code is very similar, same arguments, except after going through the scrolling text displaying the message, my idea was to have a while statement that only exits when the user hits enter, and the name would be set to the keyboard_string which gets drawn with the same font sprites. this code probably wont work without resources so I will post the engine i downloaded and if you are trial and error like me you can replace the script with mine
http://gmc.yoyogames.com/index.php?showtopic=479384
var newtext,text,xx,yy,replace,line,font;
font = spr_Font
xx = 10;
yy = 16;
line = 0;
text = argument2
i=0
draw_sprite(spr_Textbox,-1,argument0,argument1+8)
while i<string_length(argument2)
{
i+=1
newtext = string_copy(text,i,1)
if newtext = " "
{
replace=string_copy(text,i+1,string_length(text)-i)+' '
replace=string_replace_all(replace,'^','')
replace=string_replace_all(replace,'%','')
replace=string_replace_all(replace,'*','')
replace=string_pos(' ',replace)-1
if xx+8*replace>(sprite_get_width(spr_Textbox)-16)
{
line+=1
xx = 2;
yy+=16;
}
}
if line=3
{
line = 0
keyboard_wait()
xx = 2
yy = 16
screen_redraw()
draw_sprite(spr_Textbox,-1,argument0+8,argument1+8)
}
switch newtext
{
case "^": // "^" = red
font = spr_RFont
continue;
break;
case "%": // "%" = blue
font = spr_BFont
continue;
break;
case "*": // "*" = green
font = spr_GFont
continue;
break;
case " ": // def colour
font = spr_Font
}
xx+=8
str = string_to_number(newtext)
draw_sprite(font,str,argument0+xx,argument1+yy)
screen_refresh()
sleep(((100-(60*keyboard_check(vk_space))))/argument3)
if i=string_length(text)
break;
}
if newtext!=""
{
sound_play(text_finish)
xx=2
yy+=16
while (keyboard_check(vk_enter)=false)
{
for (i=0; i<string_length(keyboard_string); i+=1)
{
draw_sprite(spr_Font,string_char_at(keyboard_string,i),argument0+xx,argument1+yy) ;
};
name=keyboard_string
screen_refresh()
}
}
else
draw_text_scrolling(argument0,argument1,argument2,argument3)
Again, any help is seriously appreciated!!



Find content
Not Telling
