Page 1 of 1
Does a Word Wrap Property Exist?
Posted: Wed Feb 27, 2008 06:33
by denreaper
I was wondering if a word wrap property existed. For example, I can write window->setProperty("VertFormatting", "VertTop");
Surely there's a property such as window->setProperty("WordWrap", "true");
Furthermore, is there a list of available properties somewhere?
Thanks,
Denny
Posted: Wed Feb 27, 2008 08:04
by scriptkid
Hi,
this thread points you to two wiki pages with lots of properties:
http://www.cegui.org.uk/phpBB2/viewtopi ... ertyfinder
HTH.
Posted: Wed Feb 27, 2008 14:21
by denreaper
Thanks. That did the trick.
Posted: Wed Feb 27, 2008 14:30
by denreaper
After adding this, it appears to throw exception. Here's my code:
Code: Select all
chat_area = win->createWindow( "TaharezLook/StaticText", "InGameUI_ChatArea" );
chat_area->setText("Red Static TextRed Static TextRed Static TextRed Static TextRed Static TextRed Static TextRed Static TextRed Static Text");
chat_area->setProperty("TextColours", "tl:FFFF0000 tr:FFFF0000 bl:FFFF0000 br:FFFF0000");
chat_area->setProperty("VertFormatting", "VertTop");
chat_area->setProperty("WordWrap", "True");
chat_area->setSize(CEGUI::UVector2(CEGUI::UDim(0.9, 0), CEGUI::UDim(0.6, 0)));
chat_area->setPosition( CEGUI::UVector2(CEGUI::UDim(0.05, 0), CEGUI::UDim(0.15, 0) ) );
Posted: Wed Feb 27, 2008 21:19
by scriptkid
Hi,
try WordWrapLeftAligned, WordWrapRightAligned or WordWrapCentred. Not sure why WordWrap doesn't work. It might not be a property of the default window, and therefore throw.
Always put cegui code between try...catch(CEGUI::Exception) blocks
Posted: Thu Feb 28, 2008 04:15
by denreaper
None of those do it either.
Code: Select all
Exception: There is no Property named 'WordWrapCentred' available in the set.
It just seems as if Taharez doesn't have word wrap support or something
Thanks for your help thus far.
-Denny
Posted: Thu Feb 28, 2008 08:23
by scriptkid
Aha, sorry i didn't see it earlier. The wordwrap family are not properties themselves, but values for the 'HorzFormatting' property. This should work:
Code: Select all
chat_area->setProperty("HorzFormatting", "WordWrapLeftAligned");
Good luck!
Posted: Thu Feb 28, 2008 18:13
by denreaper
That worked perfectly. Thanks a million!
-Denny