GameMaker: Studio

GameMaker: Studio

View Stats:
Redman Feb 10, 2013 @ 9:00pm
Text box
Anybody know a simple way to create a scrolling text box, where you can hit a button after the text is fully scrolled to access the next line? (Similar to that in most RPG's)
< >
Showing 1-2 of 2 comments
M.S.T.O.P. Feb 11, 2013 @ 3:53pm 
How I did it was I have two variables: one to hold the full line of text (let's call it line) and another to hold the scrolling text (display). When the text box is running, I periodically add characters from line one-by-one to display using an Alarm event, and the text box's Draw event draws display on the game window. When the text is fully scrolled, I stop the Alarm event from triggering again until the player presses a key, which as clears display and loads the next line into line.

Hint: You can use "#" (the number sign) to form line breaks within a string, so the text doesn't spill out of the text box, e.g.:

line = "This is the first line.#This is the second line.#This is the last line."

will displayed as (e.g. with draw_text):

This is the first line.
This is the second line.
This is the last line.
Last edited by M.S.T.O.P.; Feb 11, 2013 @ 3:55pm
Redman Feb 12, 2013 @ 7:39pm 
Hey thanks man, that really helped me out.
< >
Showing 1-2 of 2 comments
Per page: 15 30 50

Date Posted: Feb 10, 2013 @ 9:00pm
Posts: 2