How can I make a dialogue box? Like the ones in FF I-VI?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
JustVisiting

How can I make a dialogue box? Like the ones in FF I-VI?

Post by JustVisiting »

I was wondering how could I display a message box at the bottom of the screen, preferably with "typewriter" effect, not alll the letters appearing at once. The problem is that if I use a FOR, like (not real c++ code):

Code: Select all

for (int i=0, i< textline.lenght(), i++)
{
  AddStatic text (100,600, textline[i]);
}
the engine hangs until the text is drawn, instead of drawing it letter by letter.
Does anyone have a class for this puropse?Or some advice?
kAd
Posts: 45
Joined: Fri Jun 10, 2005 8:46 pm

Post by kAd »

I thing what you are doing is wrong for two reasons :
- 1 - you are adding multimple staticTexts to your GUI : you have to remove and redraw your text for each cycle
- 2 - there is no delay in loop cycles, and this is why the engin hangs (i think) you have to put a sleep(delay) after each addStaticText(...)

so the code should be :

Code: Select all

IGUIStaticText * mySText=NULL;
for (int i=0, i< textline.lenght(), i++) 
{ 
  if (mySText) 
     {
       mySText->remove;
       mySText=NULL;
      }
  mySText = AddStatictext (100,600, textline[0..i]); 
  usleep(1000);
} 
hope it helps
[ Enzys http://enzys.online.fr ] : Un MMORPG français en dev (^_^)Y
Post Reply