• Advertisement
Sign in to follow this  

CEGUI Change static text style inline

This topic is 753 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a CEGUI-Window with static text in it. I also gave the text a style and the window a scroll bar, if the text is too long, to fit in the window.

 

Here is the Code, how I create the window and the text:

CEGUI::DefaultWindow* test = static_cast<CEGUI::DefaultWindow*>(m_gui.createWidget("TaharezLook/StaticText", glm::vec4(0.6f, 0.6f, 0.4f, 0.4f), glm::vec4(0.0f), "levelWindowTest"));
test->setText("Heading\n\nThis is a test for DefaultWindow with scrollable static text. \nContent\nContent\nContent\nContent\nContent\nContent\nContent\nContent");
test->setProperty("TextColours", "tl:FFFF0000 tr:FFFF0000 bl:FFFF0000 br:FFFF0000");
test->setProperty("VertScrollbar", "True");
test->setProperty("VertFormatting", "VertCentred");
test->setProperty("HorzFormatting", "HorzCentred");
test->setProperty("HorzFormatting", "WordWrapLeftAligned");

Now I want to set the style of the Text inline, so I can have multiple styles.

E.G. "Heading" should be larger and bold and "This is a test for DefaultWindow with scrollable static text" should be italic.

 

Now my question is:

Is there a way, how to set the style of the text in the setText()-Function or is there a other way, how I can have multiple styles for it?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement