• 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!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows Frames max and scrolling text

D

DavidG2372

Guest
I was trying to make a dialogue box with scrolling text by having each letter appear in a separate frame of the sprite. I got up to almost a hundred frames and saved. Then when I went back to it later there was an error message and most of the frames were gone. I tried to recreate a few of them and Game Maker crashed! So the question is this: can Game Maker only handle so many frames per sprite? And if so, how do you suggest making scrolling text? You know, text that appears one letter at a time. Thank you.
 
M

MarceloP

Guest
You can draw the text in a surface and only scroll the surface. Even better, you can then create a sprite from this surface and draw only the sprite with the text, scrolling it easily.

Note: Just don't forget that surfaces can disappear (so you should check every draw to recreate it) and that you do need to clean the sprite at the end of the object (on Clean Up event) so that you do not get a mem. leak.
 
D

DavidG2372

Guest
I think my question wasn’t clear. I don’t want scrolling text so much as text that appears one letter at a time.
 
So are you saying that each frame of your sprite is the text, just with each additional letter in each frame making up the sentence?

Code:
Frame1    Frame2   Frame3  .....
T         Th       The

Why would you want to do it that way? You can just use the draw_text command and write some code to build up the string to be displayed one letter at a time. Shaun Spalding has a good tutorial on YouTube for displaying "typing text" for an introduction (I've used it as the basis of displaying the text in the intro of the game I am working on). I would recommend using that instead of creating a sprite that builds up the text slowly, if what I showed above is what you are doing.

Here's the video if it is what you are trying to do:
 
D

DavidG2372

Guest
This tutorial is exactly what I needed. Thank you so much!
 
L

Laurent57

Guest
Hi,
I put this little code for those who would like a simple similar effect.
You just have to use an adapted font.

In create_event:
Code:
data1="
***********************************#
*    skdghskjhgjshdgjshgjshgjs    *#
* a small example to show text    *#
*   lmkfjszklgflskdghslhglkshls   *#
***********************************"
In draw_event
Code:
draw_set_color(c_black);
draw_text(85,279,string_copy(data1,0,b));
draw_set_color(c_white);
draw_text(86,280,string_copy(data1,0,b));
b+=1
 

LunaticEdit

Member
I also have smooth scrolling text. I use draw_text as well. Because I want fine control over how fast the text scrolls on the screen, I actually create an "offset" variable as a real (decimal) number. Each step I basically say:
Code:
text_offset += text_rate; // (which is 0.5 in my case).
draw_text(left, top, string_copy(dialog_text, 0, text_offset);
Granted, I support word wrapped multi-line text boxes as well as responses over a dialog tree engine, but that is the general idea of how I do the smooth scrolling.

Here's what it looks like on my game (keep in mind with my game you can skip text scrolling, which is why it sometimes jumps):
 
Top