CGUITextBox, scrolling, static text.

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.

Is this usefull?

Add it to the Wiki!
24
89%
Nope
3
11%
 
Total votes: 27

monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Post by monkeycracks »

You'll need enough text in it to scroll through
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Post by ibax »

I initialize my textBox using this code:

Code: Select all

textBox = new CGUITextBox(env->getFont("myfont.xml"),L"",env,rect<s32>(50,120,750,500),0,-1);
textBox->setText(wtemp);
textBox->setScrollbarRight(false);
textBox->setScrollModeLines(false);
textBox->setVisible(true);
but on the screen there is nothing to see... :(
the variable wtemp is not clear, it has many characters[/code]
monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Post by monkeycracks »

Also make sure you are GuiEnvironment->drawAll()

I know I'm throwing silly answers but I don't know what all you've done and haven't done because you didn't post all of your code ;)
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Post by ibax »

some other things (buttons for example are on the screen), and drawAll() is done!

when I do a wcout << wtemp, the string appears on the console, but when I use it in the program, nothing to see.

when I change the setScrollRightBar to true:

Code: Select all

textBox->setScrollbarRight(true);
also there is no scroll bar on the screen.

I'm using this to draw a scrollable text to the screen:
http://www.pltg-blacksun.de/yass/downloads/TextBox.rar
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Post by ibax »

OK, now it works fine.
the
textBox = new CGUITextBox(env->getFont("myfont.xml"),L"",env,rect<s32>(50,120,750,500),img,-1);

code is good now, I draw to the screen a blank jpg picture (img), which is parent object of my textbox. this was the problem...

thanks for the help ...
Post Reply