<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://cegui.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bertram</id>
		<title>CEGUI Wiki - Crazy Eddie's GUI System (Open Source) - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://cegui.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bertram"/>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/Special:Contributions/Bertram"/>
		<updated>2026-04-09T09:50:07Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=5671</id>
		<title>Formatting Tags in CEGUI</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=5671"/>
				<updated>2015-04-03T15:17:04Z</updated>
		
		<summary type="html">&lt;p&gt;Bertram: Actually, this doc is working for CEGUI 0.8.x now... :) + Precised a bit what image embedding code is for which version.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.8}}&lt;br /&gt;
{{VersionBadge|0.7}}&lt;br /&gt;
&lt;br /&gt;
== Some Basics ==&lt;br /&gt;
CEGUI has a nice feature that allows for formatted text in a widget, called &amp;quot;formatting tags&amp;quot;. Basically, you insert tags like:&lt;br /&gt;
&lt;br /&gt;
 [tag-name='value']&lt;br /&gt;
&lt;br /&gt;
into your strings and CEGUI does the necessary parsing (see [http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html CEGUI::BasicRenderedStringParser] class reference for details).&lt;br /&gt;
&lt;br /&gt;
It is important to note that these tags are like a 'state change', that means if you set a specific formatting option, it stays active until changed by another tag. You will see some examples later on.&lt;br /&gt;
&lt;br /&gt;
== Escaping ==&lt;br /&gt;
Sometimes you want to just display [Something] and not regard that as a control sequence. In that case, you have to escape the '''opening bracket''' - [ - only. Example&lt;br /&gt;
  \[Text text text]&lt;br /&gt;
&lt;br /&gt;
This will display:&lt;br /&gt;
  [Text text text]&lt;br /&gt;
&lt;br /&gt;
If you want to escape the string from inside C++, you have to use \\[ but you probably know that if you know your way around C++.&lt;br /&gt;
In Python it's very similar to C++ but in Lua, the backslash is not an escape character, so just writing \[ should work fine (% is the escaping character in Lua).&lt;br /&gt;
&lt;br /&gt;
== Available Tags ==&lt;br /&gt;
=== Font Colours ===&lt;br /&gt;
Changing the text colour in a string is quite easy, so let's start with that. In the following example, we will have some text shown in red, green and blue. Here's how the tags work:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00']&lt;br /&gt;
 and this is just colour [colour='FF0000FF'] formatting!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code, it looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 CEGUI::Window* textComponent =  &lt;br /&gt;
 (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow(&amp;quot;generat0r/AboutDialog/StaticText&amp;quot;);&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI &lt;br /&gt;
 can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And that's how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_colours.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A note:&lt;br /&gt;
* In case you have wondered why 4 sets of values are needed for each colour:  Red, for example, is described by [colour='FFFF0000'] where the first 'FF' is the Alpha value (fully opaque in this case), the second is the value for the red component, the third for the green component and the fourth for the blue component, like in [AARRGGBB]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Formatting ===&lt;br /&gt;
Font formatting is a bit more involved as you need to have the actual fonts and the 'font' XML files defined for each style.&lt;br /&gt;
&lt;br /&gt;
Let's assume you want to use the Arial font with the styles 'normal', '''italic''', ''''bold'''' and ''''''bold Italic''''''. This actually requires you to have four different Arial fonts. For Arial, the fonts are called as follows:&lt;br /&gt;
&lt;br /&gt;
* Arial normal (arial.ttf)&lt;br /&gt;
* Arial bold (arialbd.ttf)&lt;br /&gt;
* Arial italic (ariali.ttf)&lt;br /&gt;
* Arial bold italic (arialbi.ttf)&lt;br /&gt;
&lt;br /&gt;
If you want to tinker around with them you can find these and some more in the font manager app of your OS (Arial ships with Windows, so you can get them from the OS). Note that Arial is copyrighted, so you might want to use a free font for your app (check out [http://www.dafont.com/ DaFont] for example).&lt;br /&gt;
&lt;br /&gt;
For each font, you will now have to create the according &amp;quot;.font&amp;quot; file that tells CEGUI how to use the font:&lt;br /&gt;
&lt;br /&gt;
* Arial-10.font&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-10&amp;quot; Filename=&amp;quot;arial.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; &lt;br /&gt;
 AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Bold-10.font&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Bold-10&amp;quot; Filename=&amp;quot;arialbd.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Italic-10.font&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Italic-10&amp;quot; Filename=&amp;quot;ariali.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-BoldItalic-10.font&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-BoldItalic-10&amp;quot; Filename=&amp;quot;arialbi.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don't forget to add the font definitions into your scheme, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;GUIScheme Name=&amp;quot;VanillaSkin&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Imageset Filename=&amp;quot;Vanilla.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Bold-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Italic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-BoldItalic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-14.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;LookNFeel Filename=&amp;quot;Vanilla.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
  ..snip..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;You can also do [font='Arial-Bold-10']bold text, [font='Arial-Italic-10']italic &lt;br /&gt;
 text, [font='Arial-BoldItalic-10']bold AND italic text.[font='Arial-10']!&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_fonts.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Embedding Images ===&lt;br /&gt;
Embedding an image into text is quite easy. The required tag follows the general syntax. Consider the following tag:&lt;br /&gt;
&lt;br /&gt;
for CEGUI 0.7.x:&lt;br /&gt;
 [image='set:&amp;lt;imageset&amp;gt; image:&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
or for CEGUI 0.8.x or later:&lt;br /&gt;
 [image='&amp;lt;imageset&amp;gt;/&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
What you need to do here is specify the imageset where the image is specified and identify the image to be used. Let's assume you want to embed the MouseCursor of the TaharezLook imageset into the following text: &amp;quot;Nice, I can even embed images like this &amp;lt;mousepic here&amp;gt; into my text.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
First you need to know the name of the imageset and the name of the image. Let's have a look at &amp;quot;TaharezLook.imageset&amp;quot; for that purpose:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.tga&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot;  &lt;br /&gt;
 AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;Image Name=&amp;quot;MouseArrow&amp;quot; XPos=&amp;quot;138&amp;quot; YPos=&amp;quot;127&amp;quot; Width=&amp;quot;31&amp;quot; Height=&amp;quot;25&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the imageset is named &amp;quot;TaharezLook&amp;quot; and the wanted image is called &amp;quot;MouseArrow&amp;quot;. In code this would now look like follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image='set:TaharezLook image:MouseArrow'] &lt;br /&gt;
 into my text. &amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this is how it looks in my App:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_image embed.png]]&lt;br /&gt;
&lt;br /&gt;
Please note: The following tags have an effect on the way the image is drawn: 'padding', 'alignment' and 'colour'.&lt;br /&gt;
&lt;br /&gt;
=== Image Size ===&lt;br /&gt;
The 'image-size' tag allows you to change the size of embedded image components. The sizes in the tag are given in pixels and the format is as follows:&lt;br /&gt;
&lt;br /&gt;
 w:&amp;lt;width value&amp;gt; h:&amp;lt;height value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which specifies the width and height of a following image. So to set the size of a subsequent image to 32 pixels height and 64 pixels width, you would use:&lt;br /&gt;
&lt;br /&gt;
 [image-size='w:32 h:64']&lt;br /&gt;
&lt;br /&gt;
Here is how it might look in code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image-size='w:32 h:64']&lt;br /&gt;
 [image='set:TaharezLook image:MouseArrow'] into my text.&amp;quot;); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_image size.png]]&lt;br /&gt;
&lt;br /&gt;
Please note: To set the image-size back to the real size of the image, just set the values to zero, like so:  [image-size='w:0 h:0']&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Vertical Alignment ===&lt;br /&gt;
The vertical alignment tag allows you align elements within a text that have different heights. The overall available space on a line is always taken as the height of the tallest element plus any vertical padding, elements are then positioned within this vertical space according to the specified option. Currently, you can align an element to 'top', 'bottom', 'centre' and 'stretch'. The option 'stretch' will stretch the tagged elements vertically to fill the available space. Please note that the stretching is vertical only, aspect ratios of images and text are not maintained! This will be accounted for in the future, though.&lt;br /&gt;
&lt;br /&gt;
The following examples are valid tags for &amp;quot;vert-alignment&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 [vert-alignment='top']&lt;br /&gt;
 [vert-alignment='bottom']&lt;br /&gt;
 [vert-alignment='centre']&lt;br /&gt;
 [vert-alignment='stretch']&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Text can also be vertically aligned. It can be aligned to [vert-alignment='top']top, &lt;br /&gt;
 [vert-alignment='bottom']bottom, [vert-alignment='centre']centre and [vert-alignment='stretch']'stretch'&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_vertalign.png]]&lt;br /&gt;
&lt;br /&gt;
Please note: Embedded window elements cannot be stretched currently. This may also change in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Padding ===&lt;br /&gt;
Padding is related to the vertical alignment tag in that it also allows you to specify the setting of elements in a text. You can set individual text elements or the whole text all together. The value you give the padding tag are a number of pixels to pad the surrounding elements with. The padding tag uses a &amp;quot;rect&amp;quot; property to specify padding values, like so: 'l:&amp;lt;value&amp;gt; t:&amp;lt;value&amp;gt; r:&amp;lt;value&amp;gt; b:&amp;lt;value&amp;gt;) where &amp;quot;l&amp;quot; stands for &amp;quot;left padding, &amp;quot;t&amp;quot; stands for &amp;quot;top padding&amp;quot;, &amp;quot;r&amp;quot; stands for &amp;quot;right padding&amp;quot; and &amp;quot;b&amp;quot; stands for &amp;quot;bottom padding&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Consider the following sample text: ''&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. THIS IS PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
Our aim is to pad the text element &amp;quot;THIS IS PADDED&amp;quot; with 5 pixels of left and right padding and 10 pixels of top and bottom padding. The tag would look like this: &lt;br /&gt;
&lt;br /&gt;
 [padding='l:5 t:10 r:5 b:10']&lt;br /&gt;
&lt;br /&gt;
Use padding, for example to provide extra spacing when embedding a picture or window in text.&lt;br /&gt;
Here is the code sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco &lt;br /&gt;
 laboris nisi ut aliquip ex ea commodo consequat. [padding='l:5 t:10 r:5 b:10']THIS IS PADDED.[padding='l:0 t:0 &lt;br /&gt;
 r:0 b:0'] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla &lt;br /&gt;
 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id &lt;br /&gt;
 est laborum.&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is how it looks like in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_padding.png]]&lt;br /&gt;
&lt;br /&gt;
Please note: Don't try to translate the latin here – its complete nonsense. The &amp;quot;Lorem Ipsum&amp;quot; text has been around since the 1500s, when an unknown printer defined it as a dummy text to make a type specimen book, and it's still in use today. Strange but true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window ===&lt;br /&gt;
The 'window' tag manipulates an existing child window of the window that you set the text on, such that the window is drawn in-line with the text, which means it moves with the text automatically. The 'window' tag takes the full name of the window just as you would use it with CEGUI::WindowManager. While the named window can be any window, it only makes sense to reference windows that are attached to the window where the text will be rendered.&lt;br /&gt;
&lt;br /&gt;
So let us embed a button into our text! &lt;br /&gt;
&lt;br /&gt;
First, we define the window in our layout:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;GUILayout &amp;gt;&lt;br /&gt;
   &amp;lt;Window Type=&amp;quot;Vanilla/FrameWindow&amp;quot; Name=&amp;quot;generat0r/AboutDialog&amp;quot; &amp;gt;&lt;br /&gt;
     &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;About generat0r&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;Arial-14&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property Name=&amp;quot;TitlebarEnabled&amp;quot; Value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property Name=&amp;quot;CloseButtonEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property Name=&amp;quot;SizingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;			&lt;br /&gt;
     &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.015,0},{0.015,0},{0.45,0},{0.40,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property Name=&amp;quot;UnifiedPosition&amp;quot; Value=&amp;quot;{ {0.25, 0}, {0.25, 0} }&amp;quot; /&amp;gt;&lt;br /&gt;
     &lt;br /&gt;
     &amp;lt;Window Type=&amp;quot;Vanilla/StaticText&amp;quot; Name=&amp;quot;generat0r/AboutDialog/StaticText&amp;quot; &amp;gt;&lt;br /&gt;
       &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Demonstrates static (non editable) text. Use the controls on your right for &lt;br /&gt;
       formatting options.&amp;quot; /&amp;gt;&lt;br /&gt;
       &amp;lt;Property Name=&amp;quot;HorzExtent&amp;quot; Value=&amp;quot;361&amp;quot; /&amp;gt;&lt;br /&gt;
       &amp;lt;Property Name=&amp;quot;VertExtent&amp;quot; Value=&amp;quot;59.5854&amp;quot; /&amp;gt;&lt;br /&gt;
       &amp;lt;Property Name=&amp;quot;HorzFormatting&amp;quot; Value=&amp;quot;WordWrapLeftAligned&amp;quot; /&amp;gt;&lt;br /&gt;
       &amp;lt;Property Name=&amp;quot;VertFormatting&amp;quot; Value=&amp;quot;TopAligned&amp;quot; /&amp;gt;&lt;br /&gt;
       &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.03,0},{0.03,0},{0.97,0},{0.85,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot; &lt;br /&gt;
         &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Embedded&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
       &amp;lt;/Window&amp;gt;&lt;br /&gt;
     &amp;lt;/Window&amp;gt;&lt;br /&gt;
     &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/CloseButton&amp;quot; &amp;gt;&lt;br /&gt;
       &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Close&amp;quot; /&amp;gt;&lt;br /&gt;
       &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/Window&amp;gt;&lt;br /&gt;
   &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/GUILayout&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pay special attention to the cut out segment in the above layout! Please also note that the window I want to embed is a child of the text window.&lt;br /&gt;
&lt;br /&gt;
Our tag will look like this:&lt;br /&gt;
&lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']&lt;br /&gt;
&lt;br /&gt;
Now, you just need to embed the defined window (&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot;) into the string, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco  &lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']laboris nisi ut aliquip ex ea commodo consequat. THIS IS &lt;br /&gt;
 PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;br /&gt;
 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est &lt;br /&gt;
 laborum.&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_window.png]]&lt;br /&gt;
&lt;br /&gt;
The window tag works fine with formatting options for text. Please consider, though, that the embedded window is treated as a single entity. So if you embed a window that just draws text, the text of that window will not be split for wrapping purposes, but might have its own formatting! Padding and vertical alignments work here as well, with the exception of the 'stretch' option (which will default to 'centre' and raise a note in the CEGUI.log)&lt;br /&gt;
&lt;br /&gt;
Note: If you have not created the window you call here, you will get an 'unknown object' exception!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&amp;lt;youtube size=&amp;quot;medium&amp;quot;&amp;gt;eRC5R9aA_Zs&amp;lt;/youtube&amp;gt;&lt;br /&gt;
Dont forget to check out the demo video: [[http://www.youtube.com/watch?v=eRC5R9aA_Zs&amp;amp;feature=player_embedded Tag Formatting Demo]]&lt;br /&gt;
&lt;br /&gt;
== Feedback ==&lt;br /&gt;
Feedback is very welcome: please just PM me in the forum (my handle is 'mboeni') or leave a comment here in the wiki. :) &lt;br /&gt;
&lt;br /&gt;
[[User:Mboeni]] 13:33, 24 September 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[User:EsotericDude]] How do you display a left bracket since it initiates a tag?&lt;br /&gt;
&lt;br /&gt;
[[Category:Manuals]]&lt;/div&gt;</summary>
		<author><name>Bertram</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=5670</id>
		<title>Formatting Tags in CEGUI</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Formatting_Tags_in_CEGUI&amp;diff=5670"/>
				<updated>2015-04-03T15:14:34Z</updated>
		
		<summary type="html">&lt;p&gt;Bertram: /* Embedding Images */  Added info about how to do it in CEGUI 0.8.x&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.7}}&lt;br /&gt;
&lt;br /&gt;
== Some Basics ==&lt;br /&gt;
CEGUI has a nice feature that allows for formatted text in a widget, called &amp;quot;formatting tags&amp;quot;. Basically, you insert tags like:&lt;br /&gt;
&lt;br /&gt;
 [tag-name='value']&lt;br /&gt;
&lt;br /&gt;
into your strings and CEGUI does the necessary parsing (see [http://www.cegui.org.uk/docs/current/classCEGUI_1_1BasicRenderedStringParser.html CEGUI::BasicRenderedStringParser] class reference for details).&lt;br /&gt;
&lt;br /&gt;
It is important to note that these tags are like a 'state change', that means if you set a specific formatting option, it stays active until changed by another tag. You will see some examples later on.&lt;br /&gt;
&lt;br /&gt;
== Escaping ==&lt;br /&gt;
Sometimes you want to just display [Something] and not regard that as a control sequence. In that case, you have to escape the '''opening bracket''' - [ - only. Example&lt;br /&gt;
  \[Text text text]&lt;br /&gt;
&lt;br /&gt;
This will display:&lt;br /&gt;
  [Text text text]&lt;br /&gt;
&lt;br /&gt;
If you want to escape the string from inside C++, you have to use \\[ but you probably know that if you know your way around C++.&lt;br /&gt;
In Python it's very similar to C++ but in Lua, the backslash is not an escape character, so just writing \[ should work fine (% is the escaping character in Lua).&lt;br /&gt;
&lt;br /&gt;
== Available Tags ==&lt;br /&gt;
=== Font Colours ===&lt;br /&gt;
Changing the text colour in a string is quite easy, so let's start with that. In the following example, we will have some text shown in red, green and blue. Here's how the tags work:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI can format strings.[colour='FF00FF00']&lt;br /&gt;
 and this is just colour [colour='FF0000FF'] formatting!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code, it looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 CEGUI::Window* textComponent =  &lt;br /&gt;
 (CEGUI::Window*)CEGUI::WindowManager::getSingleton().getWindow(&amp;quot;generat0r/AboutDialog/StaticText&amp;quot;);&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;This is just some text that shows how nicely [colour='FFFF0000']CEGUI &lt;br /&gt;
 can format strings.[colour='FF00FF00'] and this is just colour [colour='FF0000FF'] formatting!&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And that's how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_colours.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A note:&lt;br /&gt;
* In case you have wondered why 4 sets of values are needed for each colour:  Red, for example, is described by [colour='FFFF0000'] where the first 'FF' is the Alpha value (fully opaque in this case), the second is the value for the red component, the third for the green component and the fourth for the blue component, like in [AARRGGBB]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Font Formatting ===&lt;br /&gt;
Font formatting is a bit more involved as you need to have the actual fonts and the 'font' XML files defined for each style.&lt;br /&gt;
&lt;br /&gt;
Let's assume you want to use the Arial font with the styles 'normal', '''italic''', ''''bold'''' and ''''''bold Italic''''''. This actually requires you to have four different Arial fonts. For Arial, the fonts are called as follows:&lt;br /&gt;
&lt;br /&gt;
* Arial normal (arial.ttf)&lt;br /&gt;
* Arial bold (arialbd.ttf)&lt;br /&gt;
* Arial italic (ariali.ttf)&lt;br /&gt;
* Arial bold italic (arialbi.ttf)&lt;br /&gt;
&lt;br /&gt;
If you want to tinker around with them you can find these and some more in the font manager app of your OS (Arial ships with Windows, so you can get them from the OS). Note that Arial is copyrighted, so you might want to use a free font for your app (check out [http://www.dafont.com/ DaFont] for example).&lt;br /&gt;
&lt;br /&gt;
For each font, you will now have to create the according &amp;quot;.font&amp;quot; file that tells CEGUI how to use the font:&lt;br /&gt;
&lt;br /&gt;
* Arial-10.font&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-10&amp;quot; Filename=&amp;quot;arial.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; &lt;br /&gt;
 AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Bold-10.font&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Bold-10&amp;quot; Filename=&amp;quot;arialbd.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-Italic-10.font&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-Italic-10&amp;quot; Filename=&amp;quot;ariali.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arial-BoldItalic-10.font&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Font Name=&amp;quot;Arial-BoldItalic-10&amp;quot; Filename=&amp;quot;arialbi.ttf&amp;quot; Type=&amp;quot;FreeType&amp;quot; Size=&amp;quot;10&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; &lt;br /&gt;
 NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;false&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don't forget to add the font definitions into your scheme, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;GUIScheme Name=&amp;quot;VanillaSkin&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;Imageset Filename=&amp;quot;Vanilla.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Bold-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-Italic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-BoldItalic-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;Font Filename=&amp;quot;Arial-14.font&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;LookNFeel Filename=&amp;quot;Vanilla.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
  ..snip..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;You can also do [font='Arial-Bold-10']bold text, [font='Arial-Italic-10']italic &lt;br /&gt;
 text, [font='Arial-BoldItalic-10']bold AND italic text.[font='Arial-10']!&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_fonts.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Embedding Images ===&lt;br /&gt;
Embedding an image into text is quite easy. The required tag follows the general syntax. Consider the following tag:&lt;br /&gt;
&lt;br /&gt;
 [image='set:&amp;lt;imageset&amp;gt; image:&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
or for CEGUI 0.8.x or later:&lt;br /&gt;
 [image='&amp;lt;imageset&amp;gt;/&amp;lt;image&amp;gt;']&lt;br /&gt;
&lt;br /&gt;
What you need to do here is specify the imageset where the image is specified and identify the image to be used. Let's assume you want to embed the MouseCursor of the TaharezLook imageset into the following text: &amp;quot;Nice, I can even embed images like this &amp;lt;mousepic here&amp;gt; into my text.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
First you need to know the name of the imageset and the name of the image. Let's have a look at &amp;quot;TaharezLook.imageset&amp;quot; for that purpose:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
 &amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.tga&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot;  &lt;br /&gt;
 AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;Image Name=&amp;quot;MouseArrow&amp;quot; XPos=&amp;quot;138&amp;quot; YPos=&amp;quot;127&amp;quot; Width=&amp;quot;31&amp;quot; Height=&amp;quot;25&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 ...&lt;br /&gt;
 &amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the imageset is named &amp;quot;TaharezLook&amp;quot; and the wanted image is called &amp;quot;MouseArrow&amp;quot;. In code this would now look like follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image='set:TaharezLook image:MouseArrow'] &lt;br /&gt;
 into my text. &amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And this is how it looks in my App:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_image embed.png]]&lt;br /&gt;
&lt;br /&gt;
Please note: The following tags have an effect on the way the image is drawn: 'padding', 'alignment' and 'colour'.&lt;br /&gt;
&lt;br /&gt;
=== Image Size ===&lt;br /&gt;
The 'image-size' tag allows you to change the size of embedded image components. The sizes in the tag are given in pixels and the format is as follows:&lt;br /&gt;
&lt;br /&gt;
 w:&amp;lt;width value&amp;gt; h:&amp;lt;height value&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which specifies the width and height of a following image. So to set the size of a subsequent image to 32 pixels height and 64 pixels width, you would use:&lt;br /&gt;
&lt;br /&gt;
 [image-size='w:32 h:64']&lt;br /&gt;
&lt;br /&gt;
Here is how it might look in code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Nice, I can even embed images like this [image-size='w:32 h:64']&lt;br /&gt;
 [image='set:TaharezLook image:MouseArrow'] into my text.&amp;quot;); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_image size.png]]&lt;br /&gt;
&lt;br /&gt;
Please note: To set the image-size back to the real size of the image, just set the values to zero, like so:  [image-size='w:0 h:0']&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Vertical Alignment ===&lt;br /&gt;
The vertical alignment tag allows you align elements within a text that have different heights. The overall available space on a line is always taken as the height of the tallest element plus any vertical padding, elements are then positioned within this vertical space according to the specified option. Currently, you can align an element to 'top', 'bottom', 'centre' and 'stretch'. The option 'stretch' will stretch the tagged elements vertically to fill the available space. Please note that the stretching is vertical only, aspect ratios of images and text are not maintained! This will be accounted for in the future, though.&lt;br /&gt;
&lt;br /&gt;
The following examples are valid tags for &amp;quot;vert-alignment&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 [vert-alignment='top']&lt;br /&gt;
 [vert-alignment='bottom']&lt;br /&gt;
 [vert-alignment='centre']&lt;br /&gt;
 [vert-alignment='stretch']&lt;br /&gt;
&lt;br /&gt;
Here is the code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Text can also be vertically aligned. It can be aligned to [vert-alignment='top']top, &lt;br /&gt;
 [vert-alignment='bottom']bottom, [vert-alignment='centre']centre and [vert-alignment='stretch']'stretch'&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_vertalign.png]]&lt;br /&gt;
&lt;br /&gt;
Please note: Embedded window elements cannot be stretched currently. This may also change in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Padding ===&lt;br /&gt;
Padding is related to the vertical alignment tag in that it also allows you to specify the setting of elements in a text. You can set individual text elements or the whole text all together. The value you give the padding tag are a number of pixels to pad the surrounding elements with. The padding tag uses a &amp;quot;rect&amp;quot; property to specify padding values, like so: 'l:&amp;lt;value&amp;gt; t:&amp;lt;value&amp;gt; r:&amp;lt;value&amp;gt; b:&amp;lt;value&amp;gt;) where &amp;quot;l&amp;quot; stands for &amp;quot;left padding, &amp;quot;t&amp;quot; stands for &amp;quot;top padding&amp;quot;, &amp;quot;r&amp;quot; stands for &amp;quot;right padding&amp;quot; and &amp;quot;b&amp;quot; stands for &amp;quot;bottom padding&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Consider the following sample text: ''&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. THIS IS PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
Our aim is to pad the text element &amp;quot;THIS IS PADDED&amp;quot; with 5 pixels of left and right padding and 10 pixels of top and bottom padding. The tag would look like this: &lt;br /&gt;
&lt;br /&gt;
 [padding='l:5 t:10 r:5 b:10']&lt;br /&gt;
&lt;br /&gt;
Use padding, for example to provide extra spacing when embedding a picture or window in text.&lt;br /&gt;
Here is the code sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco &lt;br /&gt;
 laboris nisi ut aliquip ex ea commodo consequat. [padding='l:5 t:10 r:5 b:10']THIS IS PADDED.[padding='l:0 t:0 &lt;br /&gt;
 r:0 b:0'] Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla &lt;br /&gt;
 pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id &lt;br /&gt;
 est laborum.&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is how it looks like in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_padding.png]]&lt;br /&gt;
&lt;br /&gt;
Please note: Don't try to translate the latin here – its complete nonsense. The &amp;quot;Lorem Ipsum&amp;quot; text has been around since the 1500s, when an unknown printer defined it as a dummy text to make a type specimen book, and it's still in use today. Strange but true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window ===&lt;br /&gt;
The 'window' tag manipulates an existing child window of the window that you set the text on, such that the window is drawn in-line with the text, which means it moves with the text automatically. The 'window' tag takes the full name of the window just as you would use it with CEGUI::WindowManager. While the named window can be any window, it only makes sense to reference windows that are attached to the window where the text will be rendered.&lt;br /&gt;
&lt;br /&gt;
So let us embed a button into our text! &lt;br /&gt;
&lt;br /&gt;
First, we define the window in our layout:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;GUILayout &amp;gt;&lt;br /&gt;
   &amp;lt;Window Type=&amp;quot;Vanilla/FrameWindow&amp;quot; Name=&amp;quot;generat0r/AboutDialog&amp;quot; &amp;gt;&lt;br /&gt;
     &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;About generat0r&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;Arial-14&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property Name=&amp;quot;TitlebarEnabled&amp;quot; Value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property Name=&amp;quot;CloseButtonEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property Name=&amp;quot;SizingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;			&lt;br /&gt;
     &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.015,0},{0.015,0},{0.45,0},{0.40,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property Name=&amp;quot;UnifiedPosition&amp;quot; Value=&amp;quot;{ {0.25, 0}, {0.25, 0} }&amp;quot; /&amp;gt;&lt;br /&gt;
     &lt;br /&gt;
     &amp;lt;Window Type=&amp;quot;Vanilla/StaticText&amp;quot; Name=&amp;quot;generat0r/AboutDialog/StaticText&amp;quot; &amp;gt;&lt;br /&gt;
       &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Demonstrates static (non editable) text. Use the controls on your right for &lt;br /&gt;
       formatting options.&amp;quot; /&amp;gt;&lt;br /&gt;
       &amp;lt;Property Name=&amp;quot;HorzExtent&amp;quot; Value=&amp;quot;361&amp;quot; /&amp;gt;&lt;br /&gt;
       &amp;lt;Property Name=&amp;quot;VertExtent&amp;quot; Value=&amp;quot;59.5854&amp;quot; /&amp;gt;&lt;br /&gt;
       &amp;lt;Property Name=&amp;quot;HorzFormatting&amp;quot; Value=&amp;quot;WordWrapLeftAligned&amp;quot; /&amp;gt;&lt;br /&gt;
       &amp;lt;Property Name=&amp;quot;VertFormatting&amp;quot; Value=&amp;quot;TopAligned&amp;quot; /&amp;gt;&lt;br /&gt;
       &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.03,0},{0.03,0},{0.97,0},{0.85,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
       &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot; &lt;br /&gt;
         &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Embedded&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
       &amp;lt;/Window&amp;gt;&lt;br /&gt;
     &amp;lt;/Window&amp;gt;&lt;br /&gt;
     &amp;lt;Window Type=&amp;quot;Vanilla/Button&amp;quot; Name=&amp;quot;generat0r/AboutDialog/CloseButton&amp;quot; &amp;gt;&lt;br /&gt;
       &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Close&amp;quot; /&amp;gt;&lt;br /&gt;
       &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.42,0},{0.88,0},{0.60,0},{0.955,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/Window&amp;gt;&lt;br /&gt;
   &amp;lt;/Window&amp;gt;&lt;br /&gt;
 &amp;lt;/GUILayout&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pay special attention to the cut out segment in the above layout! Please also note that the window I want to embed is a child of the text window.&lt;br /&gt;
&lt;br /&gt;
Our tag will look like this:&lt;br /&gt;
&lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']&lt;br /&gt;
&lt;br /&gt;
Now, you just need to embed the defined window (&amp;quot;generat0r/AboutDialog/EmbeddedButton&amp;quot;) into the string, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 textComponent-&amp;gt;setText(&amp;quot;Lorem ipsum dolor sit amet, consectetur adipisicing elit,sed do eiusmod tempor &lt;br /&gt;
 incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco  &lt;br /&gt;
 [window='generat0r/AboutDialog/EmbeddedButton']laboris nisi ut aliquip ex ea commodo consequat. THIS IS &lt;br /&gt;
 PADDED. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. &lt;br /&gt;
 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est &lt;br /&gt;
 laborum.&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is how it looks in my app:&lt;br /&gt;
&lt;br /&gt;
[[File:Cegui_formatting_tags_window.png]]&lt;br /&gt;
&lt;br /&gt;
The window tag works fine with formatting options for text. Please consider, though, that the embedded window is treated as a single entity. So if you embed a window that just draws text, the text of that window will not be split for wrapping purposes, but might have its own formatting! Padding and vertical alignments work here as well, with the exception of the 'stretch' option (which will default to 'centre' and raise a note in the CEGUI.log)&lt;br /&gt;
&lt;br /&gt;
Note: If you have not created the window you call here, you will get an 'unknown object' exception!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Demo Video ==&lt;br /&gt;
&amp;lt;youtube size=&amp;quot;medium&amp;quot;&amp;gt;eRC5R9aA_Zs&amp;lt;/youtube&amp;gt;&lt;br /&gt;
Dont forget to check out the demo video: [[http://www.youtube.com/watch?v=eRC5R9aA_Zs&amp;amp;feature=player_embedded Tag Formatting Demo]]&lt;br /&gt;
&lt;br /&gt;
== Feedback ==&lt;br /&gt;
Feedback is very welcome: please just PM me in the forum (my handle is 'mboeni') or leave a comment here in the wiki. :) &lt;br /&gt;
&lt;br /&gt;
[[User:Mboeni]] 13:33, 24 September 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
[[User:EsotericDude]] How do you display a left bracket since it initiates a tag?&lt;br /&gt;
&lt;br /&gt;
[[Category:Manuals]]&lt;/div&gt;</summary>
		<author><name>Bertram</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Tooltips&amp;diff=5554</id>
		<title>Tooltips</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Tooltips&amp;diff=5554"/>
				<updated>2014-11-24T13:28:27Z</updated>
		
		<summary type="html">&lt;p&gt;Bertram: Added the right statement to create a tooltip on the 0.8 version and fixed the one used for 0.5-0.7 versions. Added a few comments about certain statement used on 0.8 only.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.5}} {{VersionBadge|0.6}}&lt;br /&gt;
&lt;br /&gt;
I am not an expert but I would like to share what I have learned and gleaned about the ''Tooltip'' widget.&lt;br /&gt;
&lt;br /&gt;
API References:&lt;br /&gt;
[http://www.cegui.org.uk/api_reference/classCEGUI_1_1Tooltip.html Tooltip]&lt;br /&gt;
[http://www.cegui.org.uk/api_reference/classCEGUI_1_1System.html System]&lt;br /&gt;
&lt;br /&gt;
As you would expect, the ''Tooltip'' works very similar to most tooltip systems. Basically the user hovers the mouse over a CEGUI widget and when a specified time has elapsed the tooltip is displayed for a specified amount of time. As with most of the CEGUI widgets the ''Tooltip'' widget is based upon the CEGUI ''Window'' class widget.&lt;br /&gt;
&lt;br /&gt;
''Please note that the following example source code was gleaned and edited from project specific code so there may be some syntax errors.''&lt;br /&gt;
&lt;br /&gt;
== Creating the Default System ''Tootip'' widget ==&lt;br /&gt;
&lt;br /&gt;
CEGUI will manage a single default, system wide ''Tooltip'' widget for you that will take care of displaying your tooltip text. You have to initialize it by calling '''CEGUI::System::setDefaultTooltip()'' one time, somehwere in your code. I would recommend calling this right after initializing the CEGUI system. Here's a sample call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
  // Create default ToolTip item&lt;br /&gt;
  // On the 0.5, 0.6 and 0.7 versions only&lt;br /&gt;
  CEGUI::System::getSingleton().setDefaultTooltip( (CEGUI::utf8*)&amp;quot;TaharezLook/Tooltip&amp;quot; );&lt;br /&gt;
  // On the 0.8 version only&lt;br /&gt;
  CEGUI::System::getSingleton().getDefaultGUIContext().setDefaultTooltipType( (CEGUI::utf8*)&amp;quot;TaharezLook/Tooltip&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Yep, that's all there is too it.&lt;br /&gt;
In newer versions of CEGUI the method has been renamed to setDefaultTooltip for consistency.&lt;br /&gt;
&lt;br /&gt;
== Setting the ''Tootip'' text to display ==&lt;br /&gt;
&lt;br /&gt;
There are two methods for setting your tooltip text: In your code or in your layout file.&lt;br /&gt;
&lt;br /&gt;
'''Setting the ''Tooltip'' text in your code'''&lt;br /&gt;
&lt;br /&gt;
You can hardcode toolip text in your code by using the ''WindowObject::setTooltipText()'' function like so:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::PushButton *mPushButton = (CEGUI::PushButton *)mWinMgr-&amp;gt;createWindow(&lt;br /&gt;
(CEGUI::utf8*)&amp;quot;TaharezLook/PushButton&amp;quot;, (CEGUI::utf8*)&amp;quot;PushButton&amp;quot;);&lt;br /&gt;
// Set other properties like size, position, etc.&lt;br /&gt;
mPushButton-&amp;gt;setTooltipText(&amp;quot;This is a tooltip.&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Setting the ''Tooltip'' text in your layout (xml) file'''&lt;br /&gt;
&lt;br /&gt;
The prefered method is to set the tooltip text in your layout file and you can do it like so:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Window Type=&amp;quot;TaharezLook/Editbox&amp;quot; Name=&amp;quot;Login/EditBox/Password&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;Property Name=&amp;quot;AbsoluteRect&amp;quot; Value=&amp;quot;l:128.000000 t:0.000000 r:486.000000 b:46.000000&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;Property Name=&amp;quot;AlwaysOnTop&amp;quot; Value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;Property Name=&amp;quot;RelativeRect&amp;quot; Value=&amp;quot;l:0.250000 t:0.000000 r:0.950000 b:1.000000&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;{Enter Password Here}&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;Property Name=&amp;quot;Tooltip&amp;quot; Value=&amp;quot;Enter your password here.&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/Window&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ensure that the Tooltip is registered in your .Scheme file'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;WindowSet Filename=&amp;quot;CEGUITaharezLook&amp;quot;&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
&amp;lt;WindowFactory Name=&amp;quot;TaharezLook/Tooltip&amp;quot; /&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
&amp;lt;/WindowSet&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ensure that imageset contains graphics for the Tooltip'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Imageset Name=&amp;quot;TaharezLook&amp;quot; Imagefile=&amp;quot;TaharezLook.png&amp;quot; NativeHorzRes=&amp;quot;800&amp;quot; NativeVertRes=&amp;quot;600&amp;quot; AutoScaled=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
&amp;lt;Image Name=&amp;quot;TooltipLeftEdge&amp;quot; XPos=&amp;quot;217&amp;quot; YPos=&amp;quot;225&amp;quot; Width=&amp;quot;7&amp;quot; Height=&amp;quot;7&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;Image Name=&amp;quot;TooltipRightEdge&amp;quot; XPos=&amp;quot;246&amp;quot; YPos=&amp;quot;225&amp;quot; Width=&amp;quot;7&amp;quot; Height=&amp;quot;7&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;Image Name=&amp;quot;TooltipTopEdge&amp;quot; XPos=&amp;quot;224&amp;quot; YPos=&amp;quot;218&amp;quot; Width=&amp;quot;7&amp;quot; Height=&amp;quot;7&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;Image Name=&amp;quot;TooltipBottomEdge&amp;quot; XPos=&amp;quot;224&amp;quot; YPos=&amp;quot;248&amp;quot; Width=&amp;quot;7&amp;quot; Height=&amp;quot;7&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;Image Name=&amp;quot;TooltipTopLeft&amp;quot; XPos=&amp;quot;217&amp;quot; YPos=&amp;quot;218&amp;quot; Width=&amp;quot;7&amp;quot; Height=&amp;quot;7&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;Image Name=&amp;quot;TooltipTopRight&amp;quot; XPos=&amp;quot;246&amp;quot; YPos=&amp;quot;218&amp;quot; Width=&amp;quot;7&amp;quot; Height=&amp;quot;7&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;Image Name=&amp;quot;TooltipBottomLeft&amp;quot; XPos=&amp;quot;217&amp;quot; YPos=&amp;quot;248&amp;quot; Width=&amp;quot;7&amp;quot; Height=&amp;quot;7&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;Image Name=&amp;quot;TooltipBottomRight&amp;quot; XPos=&amp;quot;246&amp;quot; YPos=&amp;quot;248&amp;quot; Width=&amp;quot;7&amp;quot; Height=&amp;quot;7&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;Image Name=&amp;quot;TooltipMiddle&amp;quot; XPos=&amp;quot;2&amp;quot; YPos=&amp;quot;2&amp;quot; Width=&amp;quot;64&amp;quot; Height=&amp;quot;64&amp;quot; XOffset=&amp;quot;0&amp;quot; YOffset=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to display the ''Tooltip'' ==&lt;br /&gt;
&lt;br /&gt;
'''Inject Time Pulse'''&lt;br /&gt;
&lt;br /&gt;
This is a very important piece of information that is not well documented in the current CEGUI system: ''Time Pulse Injection''. The CEGUI system, to my knowledge, does not keep track of time for you by itself - it needs help. You must inject into the CEGUI System elapsed time. If you don't do this, then your ''Tooltip'' and other time sensitive window events (like fades, etc) will not work or will not work properly. What is the ''value'' you inject? The ''value'' should be the amount of time that has elapsed since the previous injection call. Both CEGUI::System and GUI Contextes must be injected. The best place to inject a time pulse into the CEGUI is in a main loop. Here are a couple of examples of how to implement this:&lt;br /&gt;
&lt;br /&gt;
'''Inject Time Pulse: via a MAIN Loop'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
clock_t mLastTimeInjection=clock();&lt;br /&gt;
...&lt;br /&gt;
// Your main loop&lt;br /&gt;
while ( true )&lt;br /&gt;
{&lt;br /&gt;
  ...&lt;br /&gt;
  // Make sure the CEGUI System is initialized and running&lt;br /&gt;
  // and if it is, inject a time pulse&lt;br /&gt;
  if ( CEGUI::System::getSingletonPtr() )&lt;br /&gt;
  {&lt;br /&gt;
    clock_t now = clock();&lt;br /&gt;
    CEGUI::System::getSingleton().injectTimePulse( ( now - mLastTimeInjection ) * 0.001f );&lt;br /&gt;
    // From the 0.8 version (next to the line above)&lt;br /&gt;
    CEGUI::System::getSingleton().getDefaultGUIContext().injectTimePulse( ( now - mLastTimeInjection ) * 0.001f );&lt;br /&gt;
    mLastTimeInjection = clock();&lt;br /&gt;
  } // CEGUI Time pulse&lt;br /&gt;
  ...&lt;br /&gt;
} // while&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Inject Time Pulse: In C++11'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;chrono&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
typedef std::chrono::duration&amp;lt;float, std::chrono::seconds::period&amp;gt; fpTime;&lt;br /&gt;
std::chrono::high_resolution_clock::time_point last_time=std::chrono::high_resolution_clock::now();&lt;br /&gt;
...&lt;br /&gt;
// Your main loop&lt;br /&gt;
while ( true ){&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
       CEGUI::System&amp;amp; system = CEGUI::System::getSingleton();&lt;br /&gt;
       auto begin = std::chrono::high_resolution_clock::now();&lt;br /&gt;
       float elapsed = fpTime(begin - last_time).count();&lt;br /&gt;
&lt;br /&gt;
       system.injectTimePulse( elapsed );&lt;br /&gt;
       // From the 0.8 version (next to the line above)&lt;br /&gt;
       system.getDefaultGUIContext().injectTimePulse( elapsed );&lt;br /&gt;
       &lt;br /&gt;
       last_time = begin;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
} // while&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Inject Time Pulse: via an Ogre::FrameListenter'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
bool clsMyFrameListener::frameStarted(const Ogre::FrameEvent&amp;amp; evt)&lt;br /&gt;
{ &lt;br /&gt;
  ...&lt;br /&gt;
  // Make sure the CEGUI System is initialized and running&lt;br /&gt;
  // and if it is, inject a time pulse&lt;br /&gt;
  if ( CEGUI::System::getSingletonPtr() )&lt;br /&gt;
    CEGUI::System::getSingleton().injectTimePulse( evt.timeSinceLastFrame)&lt;br /&gt;
    // From the 0.8 version (next to the line above)&lt;br /&gt;
    CEGUI::System::getSingleton().getDefaultGUIContext().injectTimePulse( evt.timeSinceLastFrame );&lt;br /&gt;
  ...&lt;br /&gt;
  return true;&lt;br /&gt;
} //frameStarted&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The finer the resolution of the injection, the better your fades will look. Injecting time every one second or greater will make your ''fades'' just popup instead of ''fading'' in.&lt;br /&gt;
&lt;br /&gt;
== How to offset the ''Tooltip'' so it doesn't render under the mouse ==&lt;br /&gt;
&lt;br /&gt;
'''Via LookNFeel animation'''&lt;br /&gt;
&lt;br /&gt;
One way to do this is to edit your scheme's looknfeel and change the Tooltip's FadeIn animation to affect the Position property too.&lt;br /&gt;
If the tooltip doesn't have a FadeIn animation, just add one.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;WidgetLook name=&amp;quot;TaharezLook/Tooltip&amp;quot;&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;AnimationDefinition name=&amp;quot;FadeIn&amp;quot; duration=&amp;quot;0.33&amp;quot; replayMode=&amp;quot;once&amp;quot;&amp;gt;&lt;br /&gt;
            ...&lt;br /&gt;
            &amp;lt;Affector property=&amp;quot;Position&amp;quot; interpolator=&amp;quot;UVector2&amp;quot; applicationMethod=&amp;quot;relative&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;KeyFrame position=&amp;quot;0&amp;quot; value=&amp;quot;{{0,12},{0,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/Affector&amp;gt;&lt;br /&gt;
            ...&lt;br /&gt;
        &amp;lt;/AnimationDefinition&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
    &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will offset the tooltip's x by 12 pixels (in my case, that's how wide my system mouse cursor is -- modify to suit your needs).&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
That's really all there is to it. My biggest ''gotcha'' was the not knowing about the ''CEGUI::System::injectTimePulse()'' and how important it was. Once I stumbled upon that everything else fell into place.&lt;br /&gt;
&lt;br /&gt;
Some advanced notes. You can have more than one ''Tooltip'' widget. There maybe some scenerios where just one ''Tooltip'' widget won't work (like for a different look and feel from that of the default one, etc.). You can create another ''Tooltip'' widget using the standard CEGUI method for creating all the window widgets then use the ''CEGUI::Window::setToolTip()'' function to set the widget to use the desired ''Tooltip''.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Update requested]]&lt;/div&gt;</summary>
		<author><name>Bertram</name></author>	</entry>

	</feed>