I'm working on text for message boxes (think Final Fantasy and its blue boxes). The text functions are not well documented, and they aren't working correctly. At least I don't think they are.
I've written a class for Message Boxes. I have basic drawing functionality. Here is the declaration of the main menu's message box.
//Set options for the main menu's message box.
int box_spacing = 35;
int box_size_x = dbScreenWidth ( ) - ( 2 * box_spacing );
int box_size_y = dbScreenHeight ( ) - ( 2 * box_spacing );
int box_border_size = 10;
int box_border_spacing = 10;
//Create an object for the box and set the colors to blue and white.
//Then, draw the box to the screen.
cMessageBox main_box ( box_spacing, box_spacing,
box_size_x, box_size_y,
box_border_size, box_border_spacing );
main_box.set_primary_color ( 0, 128, 255 );
main_box.set_border_color ( 255, 255, 255 );
main_box.draw ( );
Now, I'm adding the ability to incorporate text. I'm having some issues. Here's the start (message_text = char*):
void cMessageBox::write_text ( )
{
int msg_len = strlen ( message_text );
char* cur_char;
for ( int i = 0; i < msg_len; i++ )
{
cur_char = &message_text[i];
dbText ( text_spacing + ( i * dbTextSize ( ) ), text_spacing, cur_char );
}
}
This prints no text at all when message_text is set as "Hello this is a test." Also, here is a screen of the main menu.
Windows Vista Home Premium Intel Pentium Dual-Core 1.6 Ghz 1GB DDR2 RAM GeForce 8600GT Twin Turbo