I'm using windowslook for my scheme. I have several static text windows. Is there a property that I can set up that will make the text word wrap automatically without me having to force line breaks with "\n"?
Also without having the full blown CEGUI source downloaded, is there somewhere I can get all the properties of each widget type within WindowsLook? And all their possible settings?
Last text related question. I want the window length to be based on how much space is required to show the text, can this be done as well?
Thanks,
Wraith
Quick Text Question
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Quick Text Question
You can set the horizontal text formatting to perform word wrapping, like this:
The other available formatting options can be seen here
There area also properties to set these options (see below for the answer to your related question).
You can see the properties for each widget by looking up the corresponding properties namespace here
You can manually set the window size to the length of text by using Font::getTextExtents and then setting the window width. There is no simple means provided for doing this automatically.
Code: Select all
myStaticText->setHorizontalFormatting(StaticText::WordWrapLeftAligned);
The other available formatting options can be seen here
There area also properties to set these options (see below for the answer to your related question).
You can see the properties for each widget by looking up the corresponding properties namespace here
You can manually set the window size to the length of text by using Font::getTextExtents and then setting the window width. There is no simple means provided for doing this automatically.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Quick Text Question
Hi,
I have a question related to this, so I'll post it here:
I create a StaticText Widget and set the text, so far, this works. Then I want to set the HorizontalFormatting, but apparently I don't have the proper files included because I get the error, that StaticText is not a member of CEGUI, so my question:
Is the class name "StaticText" correct for this purpose? Which files do I need to include, to have the class StaticText included?
Thanks in advance for your help.
I have a question related to this, so I'll post it here:
Code: Select all
CEGUI::Window* descriptionWindow = CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/StaticText", "Name");
descriptionWindow->setText("Text");
static_cast<CEGUI::StaticText*>(descriptionWindow)->setHorizontalFormatting(CEGUI::StaticText::WordWrapLeftAligned);
I create a StaticText Widget and set the text, so far, this works. Then I want to set the HorizontalFormatting, but apparently I don't have the proper files included because I get the error, that StaticText is not a member of CEGUI, so my question:
Is the class name "StaticText" correct for this purpose? Which files do I need to include, to have the class StaticText included?
Thanks in advance for your help.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Quick Text Question
There is no StaticText class - it's all done via a custom WindowRenderer assigned to a DefaultWindow. In order to affect the StaticText specific properties, you use the property set interface, for example:
CE.
Code: Select all
CEGUI::Window* descriptionWindow = CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/StaticText", "Name");
descriptionWindow->setText("Text");
descriptionWindow->setProperty( "HorzFormatting", "WordWrapLeftAligned" );
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 0 guests