• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

RPG styled text scrolling

  • Thread starter Uneven Pixel Studios
  • Start date
U

Uneven Pixel Studios

Guest
I need some help on how to make the text draw itself in a manner similar to old RPGs.
For example, if a character was to say "hello", I need it to type h, then e, then l, etc. does anyone know how to do this
 
R

Rusty

Guest
You need to have a character counter, a variable that will count towards the max length of the string and then use string_copy to copy over the string into the draw frame in proportion to that counter. It's a pretty simple code when you know what you need to do.
Draw Event:
Code:
if text_typed<string_length(text_mesge)
{   text_typed+=0.75;}
draw_text(x,y,string_copy(text_mesge,0,ceil(text_typed)));
 
U

Uneven Pixel Studios

Guest
Thank you for helping. Now why 0.75 added to text_typed?
 
R

Rusty

Guest
0.75 in my example is the speed in which the text is drawn. You want to set it to either 0.1, 0.2, 0.25, 0.5, 0.75 or 1. Other numbers, such as 0.6, will sometimes make the system appear to be lagging as it frequently switches between taking one step or two steps to draw the next character. With 0.75, this happens much less frequently and gives a good text speed without being noticeably infrequent when it's multiplication lands on .25.

And don't worry about crediting me, a special thanks would be nice but ultimately the GMC is just happy to help. Don't be afraid to ask us for any help or advice you need.
 
Top