Dialog Box Library
For Full Moon Sweet, we created a dialog box inspired by Oli414's Dialog Text Box Lib that could be used for both the intro story and the battles. All of the code for our dialog widget was pretty self-contained, so I thought I could package it up for others to use in their own games.
How to play the demo
Z = Continue Text
X = Skip to the end of the line
How to use in your game
- Copy the dialog object from this cart and paste into your own game.
- In your game's _update function, call dialog:update() and in the _draw function, call dialog:draw().
- Whenever you want to show new text within your game, call dialog:queue("your text here").
- If you want to autoplay text, you can pass "true" as the second argument to dialog:queue and it will simply add a delay between messages instead of waiting for input.
- It is set up to queue dialog, so if you have different triggers within your game which should show text, you can queue each of those of up and it will display the text in the order you queued them.
The code for this could probably be made more efficient, so feel free to take a stab at it. Hit me up if you have any questions.
[Please log in to post a comment]