Does a Word Wrap Property Exist?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

denreaper
Just popping in
Just popping in
Posts: 7
Joined: Wed Feb 27, 2008 06:07

Does a Word Wrap Property Exist?

Postby denreaper » Wed Feb 27, 2008 06:33

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

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Wed Feb 27, 2008 08:04

Hi,

this thread points you to two wiki pages with lots of properties:
http://www.cegui.org.uk/phpBB2/viewtopi ... ertyfinder

HTH.
Check out my released snake game using Cegui!

denreaper
Just popping in
Just popping in
Posts: 7
Joined: Wed Feb 27, 2008 06:07

Postby denreaper » Wed Feb 27, 2008 14:21

Thanks. That did the trick.

denreaper
Just popping in
Just popping in
Posts: 7
Joined: Wed Feb 27, 2008 06:07

Postby denreaper » Wed Feb 27, 2008 14:30

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) ) );

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Wed Feb 27, 2008 21:19

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 :)
Check out my released snake game using Cegui!

denreaper
Just popping in
Just popping in
Posts: 7
Joined: Wed Feb 27, 2008 06:07

Postby denreaper » Thu Feb 28, 2008 04:15

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

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Thu Feb 28, 2008 08:23

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!
Check out my released snake game using Cegui!

denreaper
Just popping in
Just popping in
Posts: 7
Joined: Wed Feb 27, 2008 06:07

Postby denreaper » Thu Feb 28, 2008 18:13

That worked perfectly. Thanks a million!
-Denny


Return to “Help”

Who is online

Users browsing this forum: No registered users and 12 guests