Beginner's Help with IGUI appreciated

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
Efchen
Posts: 3
Joined: Thu Jan 10, 2008 8:29 pm

Beginner's Help with IGUI appreciated

Post by Efchen »

Hello,

I'm a beginner with Irrlicht. I want to create a simple GUI with IGUI.
I plan to divide my screen into several parts, where different information is written to.

First of all, I am looking for a common way to
a) divide the screen (I tried IGUITab or IGUIStaticText)
b) put Text to these areas, something similar to a simple printf (IGUIStaticText seems to be a STATIC text to me where nothing can be added later or overwritten).
c) clear these areas from any text.

For anyone who knows curses, something like this:
win=newwin(height, width, starty, startx);
scrollok(win, TRUE);
wclear(win);
wprintw(win, "Put a text here.");
wprintw(win, "\nPut another line of text here");
wprintw(win, "\n\nEnter something: ");
wrefresh(win);
wgetc(win);
...
and so on.

I find it difficult to get used to Irrlicht. The documentation seems good, but there are no examples. I'm tired of trying different objects without knowing if that what I do is remotely what an experienced Irrlicht user would do.

Could anybody point me into the right direction?

Thanks very much,
-Efchen
Ico
Posts: 289
Joined: Tue Aug 22, 2006 11:35 pm

Post by Ico »

There is a tutorial/example regarding GUI code.

Static text just means the user won't be able to change it. This doesn't mean you can't do it inside your program.
Efchen
Posts: 3
Joined: Thu Jan 10, 2008 8:29 pm

Post by Efchen »

Thanks for your answer.

If you speak of tutorial 5 "User Interface", I know that, but it doesn't help.
I feel like someone standing before a door, not knowing how to enter.

Any more help, perhaps?

Thanks,
-Efchen
Ico
Posts: 289
Joined: Tue Aug 22, 2006 11:35 pm

Post by Ico »

Assuming a screen resolution of 640 x 480 and I want the screen to be split into 4 text fields:

(Just some pseudo code.)

text1 = addstatictext(0,0,320,240); // top left
text2 = addstatictext(0,240,320,480); // bottom left
text3 = addstatictext(320,0,640,240); // top right
text4 = addstatictext(320,240,640,480); // bottom right

clear text:
text1->settext("");

print text:
text1->settext(text1->gettext()+"new text line\n");
Efchen
Posts: 3
Joined: Thu Jan 10, 2008 8:29 pm

Post by Efchen »

Hi,

that's easier than I assumed :-)

But it's exactly what I needed. Thank you very much!

-Efchen
Post Reply