GameMaker: Studio
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)
< >
กำลังแสดง 1-2 จาก 2 ความเห็น
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.
แก้ไขล่าสุดโดย M.S.T.O.P.; 11 ก.พ. 2013 @ 3: 55pm
Hey thanks man, that really helped me out.
< >
กำลังแสดง 1-2 จาก 2 ความเห็น
ต่อหน้า: 1530 50

วันที่โพสต์: 10 ก.พ. 2013 @ 9: 00pm
โพสต์: 2