I thought I posted this yesterday but it seems like the post disappeared.
All I'm trying to do is print text to the screen using CEGUI::Font drawText
The text doesn't show up.
So my question is, what are some possible reasons for why it doesn't show up?
My color is 1.0,1.0,1.0,1.0.
It's a valid string.
I'm printing inside the clip area, which is the whole screen.
I'm printing inside the draw area.
The font I'm using is the default font.
I have a global window.
This question is pretty much equivalent to "What are the minimum steps needed to display "Hello World" using CEGUI::Font?"
*Edit*
Also, should I call drawText before or after I call Ogre::renderOneFrame()
Drawing text using CEGUI::Font
Moderators: CEGUI MVP, CEGUI Team
Could the missing post be this one? http://www.cegui.org.uk/phpBB2/viewtopi ... =9167#9167
The "Ogre font routine" that could be useful is: http://www.ogre3d.org/wiki/index.php/MovableText
To display text I'm using StaticText (have a look at Widget Galore for sample usage). That's suitable for field labels. Another option is to use a multi line edit box. However I believe you wanted to adjust the height of a window such that it would expand/contract to suit the amount of text being displayed. This I do not know how to accomplish.
There is code to detect whether scrollbars need to be displayed within a multiline editbox. Maybe you can hook into that event and adjust the height of the window accordingly.
The "Ogre font routine" that could be useful is: http://www.ogre3d.org/wiki/index.php/MovableText
To display text I'm using StaticText (have a look at Widget Galore for sample usage). That's suitable for field labels. Another option is to use a multi line edit box. However I believe you wanted to adjust the height of a window such that it would expand/contract to suit the amount of text being displayed. This I do not know how to accomplish.
There is code to detect whether scrollbars need to be displayed within a multiline editbox. Maybe you can hook into that event and adjust the height of the window accordingly.
Thanks for the answers.
I tried using static text but it's an abstract class. Should I make a derived class then?
Regarding widgets, I'm not sure what you mean and I don't see any samples for widgets. Are you referring to the class WidgetComponent?
Maybe I should just create a window and call setText on it?
I tried using static text but it's an abstract class. Should I make a derived class then?
Regarding widgets, I'm not sure what you mean and I don't see any samples for widgets. Are you referring to the class WidgetComponent?
Maybe I should just create a window and call setText on it?
Here's my Widget Galore which presents an overview of every Cegui widget and some sample code. The Wiki contains a few nifty items within Code Snippets.
To quote myself:
In case you have not found it, the layout editor is available from http://www.cegui.org.uk/wiki/index.php/ ... _0.5.0-RC2 As of right now the link for the installer is not working. However you can retrieve the source code. Have a look at the Compiling 0.5 from source thread.
To quote myself:
The StaticText is now defunct and has been replaced by the DefaultWindow.
The currently displayed text can be specified via setText(). The color of this text can be specified via the "TextColours" property. The value of this property contains 4 color definitions: top left, top right, bottom left, and bottom right. Each color is specified as a two-digit hexadecimal value of the format AARRGGBB (alpha, red, green, blue). The text is aligned vertically via the "VertFormatting" property with a value of TopAligned, BottomAligned, or VertCentred. The text is aligned horizontally via the "HorzFormatting" property with a value of LeftAligned, RightAligned, HorzCentred, HorzJustified, WordWrapLeftAligned, WordWrapRightAligned, WordWrapCentred, or WordWrapJustified.
In case you have not found it, the layout editor is available from http://www.cegui.org.uk/wiki/index.php/ ... _0.5.0-RC2 As of right now the link for the installer is not working. However you can retrieve the source code. Have a look at the Compiling 0.5 from source thread.
Who is online
Users browsing this forum: No registered users and 11 guests