I've just discovered that the following code:
void TextBox(string a, string b, string c) // Textbox("Blah blah blah")
{
int done; // To tell when we're done.
while (!done) // While not done... loops this code.
{
// Draw the map.
Render();
// Draw a Box.
DrawWindow(5, 5, ImageWidth(screen) - 5, 15 + (FontHeight(0) * 3), screen);
// Draw the text.
PrintString(10, 10, screen, 0, a);
PrintString(10, 10 + (FontHeight(0) * 1), screen, 0, b);
PrintString(10, 10 + (FontHeight(0) * 2), screen, 0, c);
// An essential to any loop. Refreshes the screen.
// Only do after you draw everything.
ShowPage();
if (b1) // If we press button 1, enter.
{
done = 1; // We're done.
Unpress(1); // Make sure they let go of b1.
}
}
}
Can be represented as the following if it's the last function in the file:
void TextBox(string a, string b, string c) // Textbox("Blah blah blah")
{
int done; // To tell when we're done.
while (!done) // While not done... loops this code.
{
// Draw the map.
Render();
// Draw a Box.
DrawWindow(5, 5, ImageWidth(screen) - 5, 15 + (FontHeight(0) * 3), screen);
// Draw the text.
PrintString(10, 10, screen, 0, a);
PrintString(10, 10 + (FontHeight(0) * 1), screen, 0, b);
PrintString(10, 10 + (FontHeight(0) * 2), screen, 0, c);
// An essential to any loop. Refreshes the screen.
// Only do after you draw everything.
ShowPage();
if (b1) // If we press button 1, enter.
{
done = 1; // We're done.
Unpress(1); // Make sure they let go of b1.
}