Okay, this is kind of a generalized logic question more than a specific programming question, but here goes…
When making a game we have multiple options for displaying text to the user.
- We can create a small text box, and have the user press a button to continue on (Like Pokemon or Legend of Zelda, billions of games, etc.)
- We can use scrolling text that simply tells a story (Intro to Star Wars or Credits)
- We can use a scroll bar or buttons, like in a browser, to allow the reader to go at there own pace and go back if they want to reread something.
- There are probably many other ways, but I’m focusing on these for now as they apply to me.
So, my question is this, how would you go about printing this text in each of these 3 ways?
If you’re wondering why I’m asking this:
I’m planning to make a game with an ability to talk to NPCs (Text boxes). I’ll need some kind of credits at the end (Scrolling Text). Finally, I’m planning on making a quest system, which I’ll want to player to be able to go through his/her quests and get a recap on what to do and what was already done (Scroll bars)
My Ideas:
Option 1: Store the text in a single variable, and when printing, split it into a temporary array every X characters, making sure it only breaks on a space. In this sense, we would split the text up into individual lines without words being split up. Then, we would go through the temporary array as the button is pressed.
Option 2: Really just create the Text across the width and have it be it’s automatic height. Run an animation going up by Y pixels each frame and ends when the Text’s y value is equal to -Text.height. So, the bottom line goes off of the screen.
Option 3: I’m kind of stumped on a way to do this well. For small text, I was thinking of maybe having a button that would simply run through Option 1, but this way, it would force the reader to reread all of the text that was there previously which might get annoying.
EDIT: By “well” I mean easily.
Really, I guess I’m asking for Option 3, but if you have any better ideas I would appreciate before I get far into this programming.
Thank you,
SoupHead