Fangames > Programming Questions
NANG Text?
(1/1)
MatthewRPG:
( Ignore the fact that this is my first post. )
Just gonna get to the point- I've been trying to replicate the NANG textbox system, and I haven't had any dice. By the system, I mean that the dialogue types itself out, instead of appearing all at once. Help would be appriciated.
:TriHard:
lawatson:
I'd guess make a string which is the full dialog and then a blank string which gets added to each step using string_char_at(string,position). Each time the position advances a step, add that to the blank string, and play a sound if you want. Then you can clear the text if you go on to the next dialog or something. Too lazy to figure out how to do line advancement, so just use enter signs. xdd
Hope this helped. I'll bet klazen or someone can code it out for you.
Keygrin:
Here, have this old TextBox code I found:
In Create Event
--- Code: ---//this is the mssg, th '#' are new lines
message[0]="Hello World! I am Text 0!"
message[1]="Blah blah blah, I am Text 1!"
//speed
length=0;
//message id
messagen=0
alarm[0]=60 //Optional. I'd use this Alarm only if the next message will show on its own.
--- End code ---
In Alarm[0] Event
--- Code: ---if (length<string_length(message[messagen]))
alarm[0]=240
else
{
length=0
messagen+=1
alarm[0]=240
}
--- End code ---
or some Key Press Event
--- Code: ---if (length>=string_length(message[messagen]))
{
length=0
messagen+=1
}
--- End code ---
In Draw Event
--- Code: ---if (length<string_length(message[messagen]))
length+=0.25
draw_text(view_xview+0,view_yview+320,string_copy(message[messagen],0,length));
--- End code ---
Navigation
[0] Message Index
Go to full version