<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://cegui.org.uk/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Superpws</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.uk/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Superpws"/>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/Special:Contributions/Superpws"/>
		<updated>2026-04-05T08:44:40Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Auto_Repeat_Key&amp;diff=5226</id>
		<title>CEGUI In Practice - Auto Repeat Key</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Auto_Repeat_Key&amp;diff=5226"/>
				<updated>2014-03-30T08:30:46Z</updated>
		
		<summary type="html">&lt;p&gt;Superpws: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.8}}&lt;br /&gt;
{{Series|CEGUI In Practice|8}}&lt;br /&gt;
&lt;br /&gt;
== Auto Key== &lt;br /&gt;
&lt;br /&gt;
== CEGUI In Practice 8 ==&lt;br /&gt;
&lt;br /&gt;
This tutorial will build upon a previous tutorial we looked at, [[CEGUI_In_Practice_-_Managing_input | Managing Input]].&lt;br /&gt;
&lt;br /&gt;
If you've done any thing involving a keyboard recently, you'll have noticed how much you rely on RepeatKeys.  For example, when you hold down the backspace to delete something you typed, thats a RepeatKey.  CEGUI does not handle this automatically, as it is a GUI Library, not an input library.  And since CEGUI only takes single inputs, we need to do some work on our own.  I recently stumbled across an example on another website (See references) that was a good example of this.  So we'll implement it ourselves to see how to use it with CEGUI.  Below is the code.&lt;br /&gt;
&lt;br /&gt;
===The Header File===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#pragma once&lt;br /&gt;
 &lt;br /&gt;
#include &amp;lt;OIS.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
class AutoRepeatKey {&lt;br /&gt;
private:&lt;br /&gt;
 &lt;br /&gt;
    OIS::KeyCode m_nKey;&lt;br /&gt;
    unsigned int m_nChar;&lt;br /&gt;
 &lt;br /&gt;
    float m_fElapsed;&lt;br /&gt;
    float m_fDelay;&lt;br /&gt;
 &lt;br /&gt;
    float m_fRepeatDelay;&lt;br /&gt;
    float m_fInitialDelay;&lt;br /&gt;
 &lt;br /&gt;
protected:&lt;br /&gt;
 &lt;br /&gt;
    virtual void repeatKey(OIS::KeyCode a_nKey, unsigned int a_nChar) = 0;&lt;br /&gt;
 &lt;br /&gt;
public:&lt;br /&gt;
 &lt;br /&gt;
    AutoRepeatKey(float a_fRepeatDelay = 0.035f, float a_fInitialDelay = 0.300f);&lt;br /&gt;
 &lt;br /&gt;
    void begin(const OIS::KeyEvent &amp;amp;evt);&lt;br /&gt;
 &lt;br /&gt;
    void end(const OIS::KeyEvent &amp;amp;evt);&lt;br /&gt;
 &lt;br /&gt;
    void update(float a_fElapsed); // Elapsed time in seconds&lt;br /&gt;
};&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The CPP File===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;AutoRepeatKey.h&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
AutoRepeatKey::AutoRepeatKey(float a_fRepeatDelay, float a_fInitialDelay):&lt;br /&gt;
    m_nKey(OIS::KC_UNASSIGNED),&lt;br /&gt;
    m_fRepeatDelay(a_fRepeatDelay),&lt;br /&gt;
    m_fInitialDelay(a_fInitialDelay)&lt;br /&gt;
{}&lt;br /&gt;
 &lt;br /&gt;
void AutoRepeatKey::begin(const OIS::KeyEvent &amp;amp;evt) {&lt;br /&gt;
    m_nKey = evt.key;&lt;br /&gt;
    m_nChar = evt.text;&lt;br /&gt;
 &lt;br /&gt;
    m_fElapsed = 0;&lt;br /&gt;
    m_fDelay = m_fInitialDelay;&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void AutoRepeatKey::end(const OIS::KeyEvent &amp;amp;evt) {&lt;br /&gt;
    if (m_nKey != evt.key) return;&lt;br /&gt;
 &lt;br /&gt;
    m_nKey = OIS::KC_UNASSIGNED;&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void AutoRepeatKey::update(float a_fElapsed) {&lt;br /&gt;
    if (m_nKey == OIS::KC_UNASSIGNED) return;&lt;br /&gt;
 &lt;br /&gt;
    m_fElapsed += a_fElapsed;&lt;br /&gt;
    if (m_fElapsed &amp;lt; m_fDelay) return;&lt;br /&gt;
 &lt;br /&gt;
    m_fElapsed -= m_fDelay;&lt;br /&gt;
    m_fDelay = m_fRepeatDelay;&lt;br /&gt;
 &lt;br /&gt;
    do {&lt;br /&gt;
        repeatKey(m_nKey, m_nChar);&lt;br /&gt;
 &lt;br /&gt;
        m_fElapsed -= m_fRepeatDelay;&lt;br /&gt;
    } while (m_fElapsed &amp;gt;= m_fRepeatDelay);&lt;br /&gt;
 &lt;br /&gt;
    m_fElapsed = 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Understanding the Code ===&lt;br /&gt;
&lt;br /&gt;
if you think about how an auto key works there is a sequence of events that take place.  The key is pressed down and held for a certain period of time.  After that threshold of time with the key down is hit, it begins to press that key every so often.  Then once the key is released, it will stop injecting key inputs.&lt;br /&gt;
&lt;br /&gt;
=== Applying our knowledge ===&lt;br /&gt;
Pretty straight forward.  So lets do some implementation.&lt;br /&gt;
&lt;br /&gt;
Previously we wrote a few lines of code that injected input to CEGUI.  Because there is a virtual function located in AutoRepeatKey we have to create a definition of that.  We'll have to create a custom class, and then inherit AutoRepatKey:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class MyInput : public AutoRepeatKey&lt;br /&gt;
public:&lt;br /&gt;
  void InjectOISKey(bool bButtonDown, OIS::KeyEvent inKey)&lt;br /&gt;
{&lt;br /&gt;
	if (bButtonDown)&lt;br /&gt;
	{&lt;br /&gt;
		CEGUI::System::getSingleton().getDefaultGUIContext().injectKeyDown(inKey.key);&lt;br /&gt;
		CEGUI::System::getSingleton().getDefaultGUIContext().injectChar(inKey.text);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		CEGUI::System::getSingleton().getDefaultGUIContext().injectKeyUp(inKey.key);&lt;br /&gt;
	}&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
protected:&lt;br /&gt;
  void repeatKey(OIS::KeyCode a_nKey, unsigned int a_nChar){};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is what we're gonna start with.  Its pretty simple.  Right now the program will compile, but do nothing different than the previous time we visited the Input Tutorial.  &lt;br /&gt;
&lt;br /&gt;
Now, we decided that we need to acknowledge the KeyDown as the start of the autokey, and the keyup as the ending.  InjectOISKey is where we actually deal with the key being up or down, so lets mark our start and stop of the autokey detection there.  Change the InjectOISKey function to be as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InjectOISKey(bool bButtonDown, OIS::KeyEvent inKey)&lt;br /&gt;
{&lt;br /&gt;
	if (bButtonDown)&lt;br /&gt;
	{&lt;br /&gt;
		CEGUI::System::getSingleton().getDefaultGUIContext().injectKeyDown(inKey.key);&lt;br /&gt;
		CEGUI::System::getSingleton().getDefaultGUIContext().injectChar(inKey.text);&lt;br /&gt;
                begin(inKey);                   // &amp;lt;---- New line:  Trigger beginning of AutoKeyRepeat&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		CEGUI::System::getSingleton().getDefaultGUIContext().injectKeyUp(inKey.key);&lt;br /&gt;
                end(inKey);                    // &amp;lt;----- New Line:  Trigger end of AutoKeyRepeat&lt;br /&gt;
	}&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Those will start and stop the internal timers for the autokeyrepeat.&lt;br /&gt;
&lt;br /&gt;
Now we need to determine how exactly we will handle each of the key repeats. This will be pretty simple, as we just need to do the same stuff we normally do during a keypress.  Inject the KeyDown to CEGUI, inject the Char, inject the KeyUp.  Tho we don't want to just call the above function again or it would call begin/end and stuff could get strange and ugly.&lt;br /&gt;
&lt;br /&gt;
Here is the definition of repeatKey we will use&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void repeatKey(OIS::KeyCode a_nKey, unsigned int a_nChar)&lt;br /&gt;
{&lt;br /&gt;
    // Now remember the key is still down, so we need to simulate the key being released, and then repressed immediatly&lt;br /&gt;
    CEGUI::System::getSingleton().getDefaultGUIContext().injectKeyUp(a_nKey.key);   // Key UP&lt;br /&gt;
    CEGUI::System::getSingleton().getDefaultGUIContext().injectKeyDown(a_nKey.key); // Key Down&lt;br /&gt;
    CEGUI::System::getSingleton().getDefaultGUIContext().injectChar(a_nChar);       // What that key means&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now repeatKey will be called once the key has been depressed longer than our initial delay time, and will be called again for everytime the delay between keyrepeats has been met.  But we need to tell this autokey about it.  So somehwere in your code (probably around your Polling calls) you will want to call:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
MyInput::update(float inTimeDelta);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may want to add some functions to AutoRepeatKey to allow you to adjust m_fRepeatDelay and m_fInitialDelay.  right now they are adjusted by the constructor of AutoRepeatKey which may not be optimal for your implementation.&lt;br /&gt;
&lt;br /&gt;
==== Conclusion ====&lt;br /&gt;
&lt;br /&gt;
Well there you have it, stolen and ripped code implemented into our input handler.  But then again, you're using CEGUI so using foreign and alien code shouldn't be anything daunting!   &lt;br /&gt;
&lt;br /&gt;
Till next time!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
http://www.ogre3d.org/tikiwiki/Auto+Repeat+Key+Input&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Superpws</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_User_Data&amp;diff=5225</id>
		<title>CEGUI In Practice - User Data</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_User_Data&amp;diff=5225"/>
				<updated>2014-03-30T08:25:45Z</updated>
		
		<summary type="html">&lt;p&gt;Superpws: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.8}}&lt;br /&gt;
{{Series|CEGUI In Practice|7}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== CEGUI InPractice 7 ==&lt;br /&gt;
&lt;br /&gt;
This tutorial will be a short tutorial, as i will show how to do a small addon to the previous tutorial [[CEGUI In Practice - A Game Console]] showing you how to associate the ConsoleRoot with our GameConsoleWindow class. While not terribly useful in this situation, it can demonstrate a useful feature that you likely will use in your own game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== UserData ====&lt;br /&gt;
&lt;br /&gt;
User data in CEGUI is basically a void pointer. This allows you to assign a custom structure or variable to each cegui window. This is extremely useful as it allows you to greater incorporate CEGUI into your development. For the previous example we created a Class to encompass our Console window which was great as it allowed us to easily encapsulate all the CEGUI windows and their handlers into a neat and easy to use function. It was pretty easy to go from GameConsoleWindow to each of the classes (by accessing the m_ConsoleWindow in the class and getChild() method). However, its not so easy to from the CEGUI::Window back up to the class level without recompiling CEGUI and creating custom widgets, unless you use userData. &lt;br /&gt;
&lt;br /&gt;
Its almost so easy to use that its a waste of wiki space to show this, but regardless I see alot of posts about it on the IRC channel. Here is a line we would add to our CreateCEGUIWindow(); function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void GameConsoleWindow::CreateCEGUIWindow()&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
  &lt;br /&gt;
            CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()-&amp;gt;addChild(m_ConsoleWindow);&lt;br /&gt;
            (this)-&amp;gt;RegisterHandlers();&lt;br /&gt;
            m_ConsoleWindow-&amp;gt;setUserData(this);    // &amp;lt;------ Add this line&lt;br /&gt;
...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That adds a pointer to the class we're currently in, which is an instance of GameConsoleWindow. Note tho, it stores this as a void* so when we go back to this pointer later, it will not know what type of data this is, so you will need to cast it back:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
     GameConsoleWindow *ConsoleClass = NULL;&lt;br /&gt;
&lt;br /&gt;
     ConsoleClass = static_cast&amp;lt;GameConsoleWindow*&amp;gt;(m_ConsoleWindow-&amp;gt;getUserData());&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will convert the void* we stored above, into the ConsoleClass pointer. You could probably use dynamic_cast but then you'd need to turn on RTT, which is not always required for performance reasons. Regardless you can see how easily this is done. We will use this in a later tutorial demonstrating how to implement an inventory system.&lt;br /&gt;
&lt;br /&gt;
Until next time..&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Superpws</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=Category:CEGUI_In_Practice_series&amp;diff=5224</id>
		<title>Category:CEGUI In Practice series</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=Category:CEGUI_In_Practice_series&amp;diff=5224"/>
				<updated>2014-03-30T08:23:19Z</updated>
		
		<summary type="html">&lt;p&gt;Superpws: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.8}}&lt;br /&gt;
&lt;br /&gt;
Nice tutorial series by [User:Avengre] going over CEGUI concepts without delving too much into detail. Very good introductory material.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
[[Category:Series]]&lt;/div&gt;</summary>
		<author><name>Superpws</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Using_.layout_files&amp;diff=5223</id>
		<title>CEGUI In Practice - Using .layout files</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Using_.layout_files&amp;diff=5223"/>
				<updated>2014-03-30T08:22:23Z</updated>
		
		<summary type="html">&lt;p&gt;Superpws: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.8}}&lt;br /&gt;
{{Series|CEGUI In Practice|5}}&lt;br /&gt;
&lt;br /&gt;
== CEGUI InPractice 5 ==&lt;br /&gt;
&lt;br /&gt;
In this tutorial we will introduce how to use the .layout file.  This is likely what will be used for larger scale projects, where the art team isn't going to want to wait for you to recompile the source for every change they make.&lt;br /&gt;
&lt;br /&gt;
==== Meet the Layout ====&lt;br /&gt;
&lt;br /&gt;
The Layout file (.layout) is an xml file.  There exists at least two editors for layouts.  The first one is the  [[Downloads|CEGUI LayoutEditor]] This is a fairly mature editor.  Unfortunately it is deprecated and has not received any updates in sometime.  There is a new Editor (CEGUI Layout Editor 2) which is available from the SVN.  For the usage of this tutorial tho, we will not be using an editor and will be manipulating the .layout file with a plain old text editor.&lt;br /&gt;
&lt;br /&gt;
First thing to note, is its an XML file.  So proper XML formatting is required.  Second, is that it is hierarchical just like CEGUI.  We will work towards writing a Simple Console here.  I have created a console layout, and that will be the goal of this tutorial, to make a console editor like you would find in the various MMORPG's.  This is what we'll make today:&lt;br /&gt;
&lt;br /&gt;
[[File:TutorialInPractice-Console.jpg]]&amp;lt;br /&amp;gt;&lt;br /&gt;
Attached is the layout:&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;TaharezLook/FrameWindow&amp;quot; Name=&amp;quot;ConsoleRoot&amp;quot; &amp;gt;&lt;br /&gt;
        &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Chat Window&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;DejaVuSans-10&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;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.114991,0},{0.358182,0},{0.519469,0},{0.775455,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;Window Type=&amp;quot;TaharezLook/Editbox&amp;quot; Name=&amp;quot;ConsoleRoot/EditBox&amp;quot; &amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;MaxTextLength&amp;quot; Value=&amp;quot;1073741823&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.0201637,0},{0.787097,0},{0.694549,0},{0.957693,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;TextParsingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/Window&amp;gt;&lt;br /&gt;
        &amp;lt;Window Type=&amp;quot;TaharezLook/Button&amp;quot; Name=&amp;quot;ConsoleRoot/SendButton&amp;quot; &amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Send&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.732211,0},{0.812349,0},{0.928283,0},{0.946832,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/Window&amp;gt;&lt;br /&gt;
        &amp;lt;Window Type=&amp;quot;TaharezLook/Listbox&amp;quot; Name=&amp;quot;ConsoleRoot/ChatBox&amp;quot; &amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.00534809,0},{0.0131038,0},{0.949636,0},{0.762443,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;
Okay, i'll admit. I cheated and used a LayoutEditor for this. But i'm allowed to, I know what I'm doing otherwise, so do don't back talk me and do your homework.&lt;br /&gt;
&lt;br /&gt;
Erm.  Anyway, lets look at the setup of the .layout file.&lt;br /&gt;
&lt;br /&gt;
the first line &amp;lt;xml..&amp;gt;  Is just the XML Declaration, and is not important for us.&lt;br /&gt;
&lt;br /&gt;
the next line &amp;lt;GUILayout &amp;gt;  begins the .layout file as far as CEGUI is concerned.&lt;br /&gt;
&lt;br /&gt;
Next up is: &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;Window Type=&amp;quot;TaharezLook/FrameWindow&amp;quot; Name=&amp;quot;ConsoleRoot&amp;quot; &amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
This is where the meat begins.  As you can see we're creating a window of type &amp;quot;TaharezLook/FrameWindow&amp;quot; with the name &amp;quot;ConsoleRoot.&amp;quot;  &lt;br /&gt;
&lt;br /&gt;
The next lines:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;      &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Chat Window&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;DejaVuSans-10&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;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.114991,0},{0.358182,0},{0.519469,0},{0.775455,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
change various PropertySets on that new framewindow.  It sets the font, Titlebar and the area.  These could also be done in code by calling:&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window::setProperty(&amp;quot;TitlebarFont&amp;quot;,&amp;quot;DejaVuSans-10&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.Window.setProperty(&amp;quot;TitlebarFont&amp;quot;,&amp;quot;DejaVuSans-10&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
So as you can see, the scripts can be very useful allowing us to change properties outside of the code, giving the artists a great deal of usability!&lt;br /&gt;
&lt;br /&gt;
Anyway, the next line is &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;       &amp;lt;Window Type=&amp;quot;TaharezLook/Editbox&amp;quot; Name=&amp;quot;ConsoleRoot/EditBox&amp;quot; &amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;MaxTextLength&amp;quot; Value=&amp;quot;1073741823&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.0201637,0},{0.787097,0},{0.694549,0},{0.957693,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;TextParsingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/Window&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll notice this is before the &amp;lt;/Window&amp;gt; of the ConsoleRoot, so it will be created as a child in of ConsoleRoot when the script is loaded in CEGUI. Can you tell what kind of window this will be? It will be an edit box. Thats the portion of the Console Window where the user will be able to type in what they want to say. I'm not going to go into detail about the rest of the windows, as they are pretty similar to the above examples. But &amp;quot;ConsoleRoot/SendButton&amp;quot; will be the send button, and &amp;quot;ConsoleRoot/ChatBox&amp;quot; will be where the chat messages will display to.&lt;br /&gt;
&lt;br /&gt;
[Note: As you can see I adopted the Naming scheme of Parent/Child window names. This is NOT required, but I think it helps make things easier to read on code side while debugging. You wouldn't want to just name it EditBox as that would be a pretty Common name, and may conflict with other windows you create later on in the application.]&lt;br /&gt;
&lt;br /&gt;
==== Applying our knowledge ====&lt;br /&gt;
&lt;br /&gt;
Now that we have gotten an introduction to the .layout file, we should learn how to implement this knowledge. How to get the layout file to show up in CEGUI.&lt;br /&gt;
&lt;br /&gt;
This code will load the layout into a new window:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window *newWindow = CEGUI::WindowManager::getSingleton().loadLayoutFromFile(&amp;quot;MyConsole.layout&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
newWindow = PyCEGUI.WindowManager.getSingleton().loadLayoutFromFile(&amp;quot;MyConsole.layout&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pretty self explanatory. There is something to note tho, you can add a prefix to the names in this .layout file. This would be useful if you're going to add the same .layout multiple times, because after the first load you'd get name conflicts. It would find a previous &amp;quot;ConsoleRoot&amp;quot; for example. So by calling this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window *newWindow = CEGUI::WindowManager::getSingleton().loadLayoutFromFile(&amp;quot;MyConsole.layout&amp;quot;,&amp;quot;second_&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
newWindow = PyCEGUI.WindowManager.getSingleton().loadLayoutFromFile(&amp;quot;MyConsole.layout&amp;quot;,&amp;quot;second_&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
It would append &amp;quot;second_&amp;quot; to the window names (ie. &amp;quot;second_ConsoleRoot&amp;quot;); This will prevent naming errors.&lt;br /&gt;
&lt;br /&gt;
Now if we ran this right now would we be able to see the window?&lt;br /&gt;
&lt;br /&gt;
Nope. We haven't attached it to the window hierarchy have we?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()-&amp;gt;addChild(newWindow);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.System.getSingleton().getDefaultGUIContext().getRootWindow().addChild(newWindow)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
Note: This assumes that you have a GUISheet already set, otherwise this will result in a segfault!&lt;br /&gt;
&lt;br /&gt;
==== Conclusion ====&lt;br /&gt;
&lt;br /&gt;
Well we showed how to load a .layout file. So far now we know how to Start the system with Ogre, create a window and understand properties, add input, process events, and load layouts. In the next tutorial we will apply this knowledge to create a console which actually does something! Till next time.&lt;br /&gt;
&lt;br /&gt;
This list of the Window properties may be helpful in creating your .layout files: [http://static.cegui.org.uk/docs/current/classCEGUI_1_1Window.html]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Superpws</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Creating_widgets&amp;diff=5222</id>
		<title>CEGUI In Practice - Creating widgets</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Creating_widgets&amp;diff=5222"/>
				<updated>2014-03-30T08:16:57Z</updated>
		
		<summary type="html">&lt;p&gt;Superpws: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.8}}&lt;br /&gt;
{{Series|CEGUI In Practice|2}}&lt;br /&gt;
&lt;br /&gt;
== CEGUI In-Practice 2 ==&lt;br /&gt;
&lt;br /&gt;
Welcome back.  This is the second installment of CEGUI In-Practice tutorial series.  In this we will build upon the previous tutorial, [[CEGUI In Practice - Introduction]].  We will show how to create Widgets and manage them.&lt;br /&gt;
&lt;br /&gt;
=== The Widget ===&lt;br /&gt;
&lt;br /&gt;
In the last example we showed how to bootstrap the system with Ogre, and gave a brief introduction to CEGUI's script files.  Now we will work on understanding what a widget is and how to use them.  Lets jump in and create a window which will display a box with an image in the middle of the screen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window *myImageWindow = CEGUI::WindowManager::getSingleton().createWindow(&amp;quot;TaharezLook/StaticImage&amp;quot;,&amp;quot;PrettyWindow&amp;quot; ); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow = PyCEGUI.WindowManager.getSingleton().createWindow(&amp;quot;TaharezLook/StaticImage&amp;quot;,&amp;quot;PrettyWindow&amp;quot; )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CEGUI uses numerous derived classes code-side to create windows.  The base class CEGUI::Window is the generic window. the CEGUI::WindowManager calls a factory class when creating a window which returns the windows pointer. The first argument, &amp;quot;TaharezLook/StaticImage&amp;quot; tells the factory what kind of window to make.  These windows are defined in .scheme, which are subsequently defined more depth in other .xml files. The second argument is the name which the window will have.  &lt;br /&gt;
&lt;br /&gt;
[Note: As a point to note, there is no strict requirement on naming of windows, except to avoid repeat names.  Some users tend to prefer a naming convention using ParentName/ChildName.  ie.  &amp;quot;ConsoleWindow/SendButton&amp;quot; or &amp;quot;_MasterRoot/HealthBar&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
Once we have created the window, myImageWindow will be a pointer to a CEGUI::{{DoxygenClass|DefaultWindow|0.8}} which is derived from CEGUI::{{DoxygenClass|Window|0.8}}. If you look in the .scheme file you can see can see what a Widget is derived from via the TargetType= tag.&lt;br /&gt;
&lt;br /&gt;
Next we need to set some properties for this window. There are two ways of doing this. The first is via the propertyset, or the second way by calling the function. The latter way can be more annoying at times, as you may have to cast the window to the correct type to get access to the member functions, but may be more intuitive depending on how you think.&lt;br /&gt;
&lt;br /&gt;
=== The Unified Dimension System ===&lt;br /&gt;
&lt;br /&gt;
We created our widget, now we need to position it and define its size. Lets do that via code shall we?&lt;br /&gt;
&lt;br /&gt;
Before we jump in too far, we need to understand how CEGUI Handles positions. CEGUI Uses a Unified Dimension system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::UDim(scale,offset);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.UDim(scale,offset)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first number is the relative point on the screen between (0,1). So if we were looking at the X axis (left to right on the screen) a UDim(0.5,0) would be Halfway across the screen with zero pixels offset. Udim(0.0,50) would be starting at the left side of the screen +50 pixels. You can combine them too Udim(0.75,10) would be 3/4 of the way across the screen, with an additional 10 pixels.&lt;br /&gt;
&lt;br /&gt;
A point on the screen (or a UVector2) is made up of two UDims:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::UVector2(CEGUI::UDim x, CEGUI::UDim y);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.UVector2(PyCEGUI.UDim x, PyCEGUI.UDim y)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As such, a CEGUI::Rect is as you would imagine, 4 UDims&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::URect(CEGUI::Udim left,CEGUI::Udim top,CEGUI::Udim right,CEGUI::Udim bottom);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.URect(PyCEGUI.Udim left, PyCEGUI.Udim top, PyCEGUI.Udim right, PyCEGUI.Udim bottom)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So now that we know how positions are done, lets move our created window to the middle of the screen:&lt;br /&gt;
==== The Widget in Practice ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow-&amp;gt;setPosition(CEGUI::UVector2(CEGUI::UDim(0.5,0),CEGUI::UDim(0.5,0)));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow.setPosition(PyCEGUI.UVector2(PyCEGUI.UDim(0.5,0), PyCEGUI.UDim(0.5,0)))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That may look a little ugly but break it down. setPosition takes a UVector2, and each UVector2 is made up of an X and Y Udim, which is made up of a Scale and Absolute float. &lt;br /&gt;
&lt;br /&gt;
So, we have moved our window to the middle of the screen.. but CEGUI doesn't know how big to make it? So set its size to 150 pixels by 100 pixels [Note: I dropped the namespace for this to increase readability]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow-&amp;gt;setSize(USize(UDim(0,150),UDim(0,100)));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow.setSize(USize(UDim(0,150),UDim(0,100)));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case we specified the Udim using 0 for scales, and the actual pixel size in the absolute argument. The Absolute argument is additive to the scale, and in this case we didn't want to have the size be affected by the scale argument. If we were creating a splash screen that took up the entire window, we would likely want the size to be USize(UDim(1,0),UDim(1,0) with the position being at USize(Udim(0,0), UDim(0,0).&lt;br /&gt;
&lt;br /&gt;
[TODO: Add a proper description of USize which replaced UVector2 for setting size in CEGUI 0.8.3]&lt;br /&gt;
&lt;br /&gt;
Now that we have created the window to the size we want. We need to tell it what image to display! That we will do by using the PropertySet as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow-&amp;gt;setProperty(&amp;quot;Image&amp;quot;,&amp;quot;set:TaharezLook image:full_image&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow.setProperty(&amp;quot;Image&amp;quot;,&amp;quot;set:TaharezLook image:full_image&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first agument is what Property we want to set, and the second argument is what value to set. The second argument is a string broken into two pieces in this example. We need to know what ImageSet we are looking in, which is referenced following the 'set:' portion. And then the image via the 'image:' portion. In this case we want it to show the full_image.&lt;br /&gt;
&lt;br /&gt;
A Listing of properties for TaharezLook is available here [http://cegui.org.uk/wiki/Property_reference_for_TaharezLook]&lt;br /&gt;
&lt;br /&gt;
Now that we have created the window. We need to attach it to the current root window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()-&amp;gt;addChild(myImageWindow);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.System.getSingleton().getDefaultGUIContext().getRootWindow().addChild(myImageWindow)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow the Window to be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Conclusion ====&lt;br /&gt;
&lt;br /&gt;
So with this quick tutorial we got a very short introduction to PropertySet usage (Important!) and a little bit about how the Unified Dimension System in CEGUI Works. While still not terribly useful, we're beginning to understand how to use some of CEGUI's faculties. Next up, we'll learn how to get some interactivity from this thing.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Superpws</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Creating_widgets&amp;diff=5221</id>
		<title>CEGUI In Practice - Creating widgets</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Creating_widgets&amp;diff=5221"/>
				<updated>2014-03-30T08:15:01Z</updated>
		
		<summary type="html">&lt;p&gt;Superpws: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.8}}&lt;br /&gt;
{{Series|CEGUI In Practice|2}}&lt;br /&gt;
&lt;br /&gt;
== CEGUI In-Practice 2 ==&lt;br /&gt;
&lt;br /&gt;
Welcome back.  This is the second installment of CEGUI In-Practice tutorial series.  In this we will build upon the previous tutorial, [[CEGUI In Practice - Introduction]].  We will show how to create Widgets and manage them.&lt;br /&gt;
&lt;br /&gt;
=== The Widget ===&lt;br /&gt;
&lt;br /&gt;
In the last example we showed how to bootstrap the system with Ogre, and gave a brief introduction to CEGUI's script files.  Now we will work on understanding what a widget is and how to use them.  Lets jump in and create a window which will display a box with an image in the middle of the screen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window *myImageWindow = CEGUI::WindowManager::getSingleton().createWindow(&amp;quot;TaharezLook/StaticImage&amp;quot;,&amp;quot;PrettyWindow&amp;quot; ); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow = PyCEGUI.WindowManager.getSingleton().createWindow(&amp;quot;TaharezLook/StaticImage&amp;quot;,&amp;quot;PrettyWindow&amp;quot; )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CEGUI uses numerous derived classes code-side to create windows.  The base class CEGUI::Window is the generic window. the CEGUI::WindowManager calls a factory class when creating a window which returns the windows pointer. The first argument, &amp;quot;TaharezLook/StaticImage&amp;quot; tells the factory what kind of window to make.  These windows are defined in .scheme, which are subsequently defined more depth in other .xml files. The second argument is the name which the window will have.  &lt;br /&gt;
&lt;br /&gt;
[Note: As a point to note, there is no strict requirement on naming of windows, except to avoid repeat names.  Some users tend to prefer a naming convention using ParentName/ChildName.  ie.  &amp;quot;ConsoleWindow/SendButton&amp;quot; or &amp;quot;_MasterRoot/HealthBar&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
Once we have created the window, myImageWindow will be a pointer to a CEGUI::{{DoxygenClass|DefaultWindow|0.8}} which is derived from CEGUI::{{DoxygenClass|Window|0.8}}. If you look in the .scheme file you can see can see what a Widget is derived from via the TargetType= tag.&lt;br /&gt;
&lt;br /&gt;
Next we need to set some properties for this window. There are two ways of doing this. The first is via the propertyset, or the second way by calling the function. The latter way can be more annoying at times, as you may have to cast the window to the correct type to get access to the member functions, but may be more intuitive depending on how you think.&lt;br /&gt;
&lt;br /&gt;
=== The Unified Dimension System ===&lt;br /&gt;
&lt;br /&gt;
We created our widget, now we need to position it and define its size. Lets do that via code shall we?&lt;br /&gt;
&lt;br /&gt;
Before we jump in too far, we need to understand how CEGUI Handles positions. CEGUI Uses a Unified Dimension system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::UDim(scale,offset);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.UDim(scale,offset)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first number is the relative point on the screen between (0,1). So if we were looking at the X axis (left to right on the screen) a UDim(0.5,0) would be Halfway across the screen with zero pixels offset. Udim(0.0,50) would be starting at the left side of the screen +50 pixels. You can combine them too Udim(0.75,10) would be 3/4 of the way across the screen, with an additional 10 pixels.&lt;br /&gt;
&lt;br /&gt;
A point on the screen (or a UVector2) is made up of two UDims:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::UVector2(CEGUI::UDim x, CEGUI::UDim y);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.UVector2(PyCEGUI.UDim x, PyCEGUI.UDim y)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As such, a CEGUI::Rect is as you would imagine, 4 UDims&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::URect(CEGUI::Udim left,CEGUI::Udim top,CEGUI::Udim right,CEGUI::Udim bottom);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.URect(PyCEGUI.Udim left, PyCEGUI.Udim top, PyCEGUI.Udim right, PyCEGUI.Udim bottom)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So now that we know how positions are done, lets move our created window to the middle of the screen:&lt;br /&gt;
==== The Widget in Practice ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow-&amp;gt;setPosition(CEGUI::UVector2(CEGUI::UDim(0.5,0),CEGUI::UDim(0.5,0)));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow.setPosition(PyCEGUI.UVector2(PyCEGUI.UDim(0.5,0), PyCEGUI.UDim(0.5,0)))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That may look a little ugly but break it down. setPosition takes a UVector2, and each UVector2 is made up of an X and Y Udim, which is made up of a Scale and Absolute float. &lt;br /&gt;
&lt;br /&gt;
So, we have moved our window to the middle of the screen.. but CEGUI doesn't know how big to make it? So set its size to 150 pixels by 100 pixels [Note: I dropped the namespace for this to increase readability]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow-&amp;gt;setSize(USize(UDim(0,150),UDim(0,100)));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow.setSize(USize(UDim(0,150),UDim(0,100)));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case we specified the Udim using 0 for scales, and the actual pixel size in the absolute argument. The Absolute argument is additive to the scale, and in this case we didn't want to have the size be affected by the scale argument. If we were creating a splash screen that took up the entire window, we would likely want the size to be USize(UDim(1,0),UDim(1,0) with the position being at USize(Udim(0,0), UDim(0,0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now that we have created the window to the size we want. We need to tell it what image to display! That we will do by using the PropertySet as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow-&amp;gt;setProperty(&amp;quot;Image&amp;quot;,&amp;quot;set:TaharezLook image:full_image&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow.setProperty(&amp;quot;Image&amp;quot;,&amp;quot;set:TaharezLook image:full_image&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first agument is what Property we want to set, and the second argument is what value to set. The second argument is a string broken into two pieces in this example. We need to know what ImageSet we are looking in, which is referenced following the 'set:' portion. And then the image via the 'image:' portion. In this case we want it to show the full_image.&lt;br /&gt;
&lt;br /&gt;
A Listing of properties for TaharezLook is available here [http://cegui.org.uk/wiki/Property_reference_for_TaharezLook]&lt;br /&gt;
&lt;br /&gt;
Now that we have created the window. We need to attach it to the current root window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()-&amp;gt;addChild(myImageWindow);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.System.getSingleton().getDefaultGUIContext().getRootWindow().addChild(myImageWindow)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow the Window to be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Conclusion ====&lt;br /&gt;
&lt;br /&gt;
So with this quick tutorial we got a very short introduction to PropertySet usage (Important!) and a little bit about how the Unified Dimension System in CEGUI Works. While still not terribly useful, we're beginning to understand how to use some of CEGUI's faculties. Next up, we'll learn how to get some interactivity from this thing.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Superpws</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_A_push_button&amp;diff=5220</id>
		<title>CEGUI In Practice - A push button</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_A_push_button&amp;diff=5220"/>
				<updated>2014-03-30T08:08:49Z</updated>
		
		<summary type="html">&lt;p&gt;Superpws: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.8}}&lt;br /&gt;
{{Series|CEGUI In Practice|4}}&lt;br /&gt;
&lt;br /&gt;
== CEGUI In-Practice 4 ==&lt;br /&gt;
&lt;br /&gt;
Hello hello, you're making good headway through these tutorials! Alright, last lesson we got a glimpse of how to send input to CEGUI. This is useful, because today we're going to make a button. And not just any button, but a button which makes something happen! I know, exciting.&lt;br /&gt;
&lt;br /&gt;
==== Some groundwork ====&lt;br /&gt;
&lt;br /&gt;
First we need to look into how CEGUI handles event control. &lt;br /&gt;
&lt;br /&gt;
CEGUI is based around the Event/Subscriber method. Meaning, something (A button, an edit box, a list box) fires off an event (MouseClick,Text Accepted, or Selection), and something else (The Application Class, another CEGUI Widget, anything!) is informed about it. It does this via the &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;CEGUI::Window::subscribeEvent(const String&amp;amp; name,Event::Subscriber subscriber) &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first argument is the Event that you wish to keep track of. Events are static const strings. You will find these in the respective header files for CEGUI Widget types. (Example CEGUIPushButton contains CEGUI::PushButton::EventClicked)&lt;br /&gt;
&lt;br /&gt;
The second argument is the subscriber which will be called whenever this event occurs. &lt;br /&gt;
&lt;br /&gt;
Let's give an example of how to register our character to jump whenever a button is pressed. First, let's create our Button, which will make our character jump. Although this is bad coding style, we will create the button in global scope for ease of this example. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window *gJumpBtnWindow = NULL;&lt;br /&gt;
&lt;br /&gt;
void CreateJumpButton()&lt;br /&gt;
{&lt;br /&gt;
  gJumpBtnWindow = CEGUI::WindowManager::getSingleton().createWindow(&amp;quot;TaharezLook/Button&amp;quot;,&amp;quot;JumpPushButton&amp;quot;);  // Create Window&lt;br /&gt;
  gJumpBtnWindow-&amp;gt;setPosition(CEGUI::UVector2(CEGUI::UDim(0.75,0),CEGUI::UDim(0.50,0)));&lt;br /&gt;
  gJumpBtnWindow-&amp;gt;setSize(CEGUI::USize(CEGUI::UDim(0,50),CEGUI::UDim(0,50)));&lt;br /&gt;
  gJumpBtnWindow-&amp;gt;setText(&amp;quot;Jump!&amp;quot;);&lt;br /&gt;
  CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()-&amp;gt;addChild(gJumpBtnWindow);  &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code Creates the button of type &amp;quot;TaharezLook/Button&amp;quot;, as exists in the .scheme file. Then it gives it the name of &amp;quot;JumpPushButton&amp;quot; and sets its size and position, followed by attaching it to the root GUI Window. This is review from two tutorials ago. However, the setText one is new. It's pretty Self explanatory I would assume, but it Sets the text for windows. PushButtons, EditBoxes, FrameWindows, etc. all have a spot to display text and this function will do it.&lt;br /&gt;
&lt;br /&gt;
Now that we have created our button, let's create a class that will receive this JumpPushButton's events. Please remember this is an example. In your application, it likely won't be this simple! &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class OurPlayer&lt;br /&gt;
{&lt;br /&gt;
   public:&lt;br /&gt;
    OurPlayer()&lt;br /&gt;
    {&lt;br /&gt;
     RegisterForEvents();   // Call our Register function&lt;br /&gt;
    };&lt;br /&gt;
    bool Jump(const CEGUI::EventArgs&amp;amp; /*e*/){};        // Jump for joy&lt;br /&gt;
   private:&lt;br /&gt;
    RegisterForEvents()&lt;br /&gt;
    {&lt;br /&gt;
       gJumpBtnWindow-&amp;gt;subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&amp;amp;OurPlayer::Jump,this));&lt;br /&gt;
    };&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alright, that's a neat little class right? I don't know how you're going to make your character jump, so you get to fill in that information. I'm just gonna show you how to interact with the GUI! &lt;br /&gt;
&lt;br /&gt;
Alright, the really interesting line here is the RegisterForEvents() function. You may or may not have dealt with EventSubscribers before in other applications, so I will give a very brief intro to them. &lt;br /&gt;
&lt;br /&gt;
Basically, they work by creating a structure which is supplied to CEGUI stating what function to call, and where to get an instance of a member that has that function. the first argument, &amp;amp;OurPlayer::Jump states that we want to use the function Jump which is a member of OurPlayer. The problem is it doesn't know WHICH OurPlayer we want to use. What if we are playing split screen and we have two OurPlayer classes? One for the Left player and one for the Right player? Now we need to specify which player. There is the second argument. In C++, '''this''' returns a pointer to the class execution is currently in. So since we're registering this event within a class, we tell it to use this, which will reference the class that called RegisterForEvents(); &lt;br /&gt;
&lt;br /&gt;
If we had created as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
OurPlayer *leftPlayer;&lt;br /&gt;
OurPlayer *rightPlayer;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then we would call the function like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
gJumpBtnWindow-&amp;gt;subscribeEvent(CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(&amp;amp;OurPlayer::Jump,leftPlayer));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So as you can see this allows for a lot of possibilities. There are also events for:&lt;br /&gt;
&lt;br /&gt;
* MouseClicked, &lt;br /&gt;
* MouseEnters, &lt;br /&gt;
* MouseLeaves,&lt;br /&gt;
* EventActivated,&lt;br /&gt;
* EventTextChanged,&lt;br /&gt;
* EventAlphaChanged,&lt;br /&gt;
* EventSized&lt;br /&gt;
&lt;br /&gt;
Just to name a few. There is a Huge listing of events which all windows inherit in CEGUIWindow.h&lt;br /&gt;
&lt;br /&gt;
==== Conclusion ====&lt;br /&gt;
&lt;br /&gt;
Hopefully this tutorial showed you how to implement events in cegui. They really are the mechanism which all things happen. Once you master how to use events, the rest of the GUI becomes so easy to use, as most user interactions are event driven. While you may not use them all, there are even events for Rotating windows and dropping windows on other windows! Just think of the possibilities. Until next time Happy Clicking!&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Superpws</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Managing_input&amp;diff=5219</id>
		<title>CEGUI In Practice - Managing input</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Managing_input&amp;diff=5219"/>
				<updated>2014-03-30T08:03:15Z</updated>
		
		<summary type="html">&lt;p&gt;Superpws: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.8}}&lt;br /&gt;
{{Series|CEGUI In Practice|3}}&lt;br /&gt;
&lt;br /&gt;
== CEGUI In-Practice ==&lt;br /&gt;
&lt;br /&gt;
Once again Welcome back! In this tutorial we will learn how to interact with the CEGUI System at runtime, a VERY useful feature to have for a Graphical User '''Interface'''! &lt;br /&gt;
&lt;br /&gt;
CEGUI Has been designed to work on many systems, using many different renderers. As such it is tied to no particular input system. Unfortunately for us to demonstrate how to interact with CEGUI, we need to pick one and USE it don't we? So I have decided to use OIS [http://sourceforge.net/projects/wgois/]. Although I will attempt to keep OIS Specific functions and structures seperate, if they slip in, there is the reference to the system I'm using.&lt;br /&gt;
&lt;br /&gt;
==== Input Injection ====&lt;br /&gt;
&lt;br /&gt;
The first thing to note, is that not surprisingly CEGUI has made it easy to deal with inputing user actions into CEGUI. Whenever an action happens (User typing, hitting Escape, clicking a button) CEGUI will need to be informed about it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::System::getSingleton().getDefaultGUIContext().injectKeyDown(uint key_code); // Tells CEGUI Key has been Pressed&lt;br /&gt;
CEGUI::System::getSingleton().getDefaultGUIContext().injectKeyUp(uint key_code); // Tells CEGUI Key has been Released&lt;br /&gt;
&lt;br /&gt;
CEGUI::System::getSingleton().getDefaultGUIContext().injectChar(utf32 code_point); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Inject keydown/up are good for sending Shift, controls, enters, etc. While the injectChar is pretty self explanatory for what it means, it injects a 'letter'.&lt;br /&gt;
&lt;br /&gt;
Handling the mouse works in a similiar method as above. The following code shows how you would inform CEGUI about a Left Mouse Button Keypress.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;CEGUI::System::getSingleton().getDefaultGUIContext().injectMouseButtonDown(CEGUI::MouseButton::LeftButton);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can imagine, there is a injectMouseButtonUp() as well for letting CEGUI know when the mouse is released.&lt;br /&gt;
&lt;br /&gt;
And what about when the mouse itself moves? Of course thats covered&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;CEGUI::System::getSingleton().getDefaultGUIContext().injectMouseMove(float delta_x, float delta_y);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The delta is in Screen pixels that the mouse moved since the last CEGUI Update. &lt;br /&gt;
&lt;br /&gt;
Up until know, we haven't actually given CEGUI any processor time. If we're going to be moving a mouse, or clicking buttons, we're going to want CEGUI to display these actions. So we need to let CEGUI know how much time has passed since its last render.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;CEGUI::System::getSingleton().injectTimePulse(float timeElapsed);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows you to inject a time pulse, based on the number of Seconds that have passed. However often you update CEGUI is up to you, but most games will want to update the GUI by injectingTime pulses during every update cycle. If you're building more of a Tool Application you might not need constant updates.&lt;br /&gt;
&lt;br /&gt;
==== On ward! ====&lt;br /&gt;
&lt;br /&gt;
I'm going to assume that you are using OIS and are knowledgable about its uses. Here are two functions which will allow you to interact with CEGUI&lt;br /&gt;
&lt;br /&gt;
The following will input keypresses when typing. It injects the key down and up actions (By key code) and the characters that associate with those keypresses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InjectOISKey(bool bButtonDown, OIS::KeyEvent inKey)&lt;br /&gt;
{&lt;br /&gt;
	if (bButtonDown)&lt;br /&gt;
	{&lt;br /&gt;
		CEGUI::System::getSingleton().getDefaultGUIContext().injectKeyDown(inKey.key);&lt;br /&gt;
		CEGUI::System::getSingleton().getDefaultGUIContext().injectChar(inKey.text);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		CEGUI::System::getSingleton().getDefaultGUIContext().injectKeyUp(inKey.key);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following function will handle injection of OIS Mouse Button presses and releases&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void InjectOISMouseButton(bool bButtonDown, OIS::MouseButtonID inButton)&lt;br /&gt;
{&lt;br /&gt;
	if (bButtonDown == true)&lt;br /&gt;
	{&lt;br /&gt;
		switch (inButton)&lt;br /&gt;
		{&lt;br /&gt;
		case OIS::MB_Left:&lt;br /&gt;
			CEGUI::System::getSingleton().getDefaultGUIContext().injectMouseButtonDown(CEGUI::LeftButton);&lt;br /&gt;
			break;&lt;br /&gt;
		case OIS::MB_Middle:&lt;br /&gt;
			CEGUI::System::getSingleton().getDefaultGUIContext().injectMouseButtonDown(CEGUI::MiddleButton);&lt;br /&gt;
			break;&lt;br /&gt;
		case OIS::MB_Right:&lt;br /&gt;
			CEGUI::System::getSingleton().getDefaultGUIContext().injectMouseButtonDown(CEGUI::RightButton);&lt;br /&gt;
			break;&lt;br /&gt;
		case OIS::MB_Button3:&lt;br /&gt;
			CEGUI::System::getSingleton().getDefaultGUIContext().injectMouseButtonDown(CEGUI::X1Button);&lt;br /&gt;
			break;&lt;br /&gt;
		case OIS::MB_Button4:&lt;br /&gt;
			CEGUI::System::getSingleton().getDefaultGUIContext().injectMouseButtonDown(CEGUI::X2Button);&lt;br /&gt;
			break;&lt;br /&gt;
		default:	&lt;br /&gt;
			break;&lt;br /&gt;
&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	else // bButtonDown = false&lt;br /&gt;
	{&lt;br /&gt;
		switch (inButton)&lt;br /&gt;
		{&lt;br /&gt;
		case OIS::MB_Left:&lt;br /&gt;
			CEGUI::System::getSingleton().getDefaultGUIContext().injectMouseButtonUp(CEGUI::LeftButton);&lt;br /&gt;
			break;&lt;br /&gt;
		case OIS::MB_Middle:&lt;br /&gt;
			CEGUI::System::getSingleton().getDefaultGUIContext().injectMouseButtonUp(CEGUI::MiddleButton);&lt;br /&gt;
			break;&lt;br /&gt;
		case OIS::MB_Right:&lt;br /&gt;
			CEGUI::System::getSingleton().getDefaultGUIContext().injectMouseButtonUp(CEGUI::RightButton);&lt;br /&gt;
			break;&lt;br /&gt;
		case OIS::MB_Button3:&lt;br /&gt;
			CEGUI::System::getSingleton().getDefaultGUIContext().injectMouseButtonUp(CEGUI::X1Button);&lt;br /&gt;
			break;&lt;br /&gt;
		case OIS::MB_Button4:&lt;br /&gt;
			CEGUI::System::getSingleton().getDefaultGUIContext().injectMouseButtonUp(CEGUI::X2Button);&lt;br /&gt;
			break;&lt;br /&gt;
		default:	&lt;br /&gt;
			break;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This above function will Convert a OIS Input for the mouse and change it to CEGUI. Right now the codes match, but if they ever change it will provide an example of how to use OIS with CEGUI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Conclusion ====&lt;br /&gt;
&lt;br /&gt;
Understandably this section is a little quicker. But it gives you information about how to start interacting with CEGUI. The next tutorial will teach us how to actually deal with keypresses and make interesting things happen. Until then!&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Superpws</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Creating_widgets&amp;diff=5218</id>
		<title>CEGUI In Practice - Creating widgets</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Creating_widgets&amp;diff=5218"/>
				<updated>2014-03-30T07:40:24Z</updated>
		
		<summary type="html">&lt;p&gt;Superpws: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.8}}&lt;br /&gt;
{{Series|CEGUI In Practice|2}}&lt;br /&gt;
&lt;br /&gt;
== CEGUI In-Practice 2 ==&lt;br /&gt;
&lt;br /&gt;
Welcome back.  This is the second installment of CEGUI In-Practice tutorial series.  In this we will build upon the previous tutorial, [[CEGUI In Practice - Introduction]].  We will show how to create Widgets and manage them.&lt;br /&gt;
&lt;br /&gt;
=== The Widget ===&lt;br /&gt;
&lt;br /&gt;
In the last example we showed how to bootstrap the system with Ogre, and gave a brief introduction to CEGUI's script files.  Now we will work on understanding what a widget is and how to use them.  Lets jump in and create a window which will display a box with an image in the middle of the screen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window *myImageWindow = CEGUI::WindowManager::getSingleton().createWindow(&amp;quot;TaharezLook/StaticImage&amp;quot;,&amp;quot;PrettyWindow&amp;quot; ); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow = PyCEGUI.WindowManager.getSingleton().createWindow(&amp;quot;TaharezLook/StaticImage&amp;quot;,&amp;quot;PrettyWindow&amp;quot; )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CEGUI uses numerous derived classes code-side to create windows.  The base class CEGUI::Window is the generic window. the CEGUI::WindowManager calls a factory class when creating a window which returns the windows pointer. The first argument, &amp;quot;TaharezLook/StaticImage&amp;quot; tells the factory what kind of window to make.  These windows are defined in .scheme, which are subsequently defined more depth in other .xml files. The second argument is the name which the window will have.  &lt;br /&gt;
&lt;br /&gt;
[Note: As a point to note, there is no strict requirement on naming of windows, except to avoid repeat names.  Some users tend to prefer a naming convention using ParentName/ChildName.  ie.  &amp;quot;ConsoleWindow/SendButton&amp;quot; or &amp;quot;_MasterRoot/HealthBar&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
Once we have created the window, myImageWindow will be a pointer to a CEGUI::{{DoxygenClass|DefaultWindow|0.8}} which is derived from CEGUI::{{DoxygenClass|Window|0.8}}. If you look in the .scheme file you can see can see what a Widget is derived from via the TargetType= tag.&lt;br /&gt;
&lt;br /&gt;
Next we need to set some properties for this window. There are two ways of doing this. The first is via the propertyset, or the second way by calling the function. The latter way can be more annoying at times, as you may have to cast the window to the correct type to get access to the member functions, but may be more intuitive depending on how you think.&lt;br /&gt;
&lt;br /&gt;
=== The Unified Dimension System ===&lt;br /&gt;
&lt;br /&gt;
We created our widget, now we need to position it and define its size. Lets do that via code shall we?&lt;br /&gt;
&lt;br /&gt;
Before we jump in too far, we need to understand how CEGUI Handles positions. CEGUI Uses a Unified Dimension system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::UDim(scale,offset);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.UDim(scale,offset)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first number is the relative point on the screen between (0,1). So if we were looking at the X axis (left to right on the screen) a UDim(0.5,0) would be Halfway across the screen with zero pixels offset. Udim(0.0,50) would be starting at the left side of the screen +50 pixels. You can combine them too Udim(0.75,10) would be 3/4 of the way across the screen, with an additional 10 pixels.&lt;br /&gt;
&lt;br /&gt;
A point on the screen (or a UVector2) is made up of two UDims:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::UVector2(UDim x,UDim y);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.UVector2(UDim x, UDim y)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As such, a CEGUI::Rect is as you would imagine, 4 UDims&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::URect(CEGUI::Udim left,CEGUI::Udim top,CEGUI::Udim right,CEGUI::Udim bottom);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.URect(PyCEGUI.Udim left, PyCEGUI.Udim top, PyCEGUI.Udim right, PyCEGUI.Udim bottom)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So now that we know how positions are done, lets move our created window to the middle of the screen:&lt;br /&gt;
==== The Widget in Practice ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow-&amp;gt;setPosition(CEGUI::UVector2(CEGUI::UDim(0.5,0),CEGUI::UDim(0.5,0)));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow.setPosition(PyCEGUI.UVector2(PyCEGUI.UDim(0.5,0), PyCEGUI.UDim(0.5,0)))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That may look a little ugly but break it down. setPosition takes a UVector2, and each UVector2 is made up of an X and Y Udim, which is made up of a Scale and Absolute float. &lt;br /&gt;
&lt;br /&gt;
So, we have moved our window to the middle of the screen.. but CEGUI doesn't know how big to make it? So set its size to 150 pixels by 100 pixels [Note: I dropped the namespace for this to increase readability]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow-&amp;gt;setSize(UVector2(UDim(0,150),UDim(0,100)));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow.setSize(UVector2(UDim(0,150),UDim(0,100)));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case we specified the Udim using 0 for scales, and the actual pixel size in the absolute argument. The Absolute argument is additive to the scale, and in this case we didn't want to have the size be affected by the scale argument. If we were creating a splash screen that took up the entire window, we would likely want the size to be UVector2(UDim(1,0),UDim(1,0) with the position being at UVector2(Udim(0,0), UDim(0,0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now that we have created the window to the size we want. We need to tell it what image to display! That we will do by using the PropertySet as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow-&amp;gt;setProperty(&amp;quot;Image&amp;quot;,&amp;quot;set:TaharezLook image:full_image&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow.setProperty(&amp;quot;Image&amp;quot;,&amp;quot;set:TaharezLook image:full_image&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first agument is what Property we want to set, and the second argument is what value to set. The second argument is a string broken into two pieces in this example. We need to know what ImageSet we are looking in, which is referenced following the 'set:' portion. And then the image via the 'image:' portion. In this case we want it to show the full_image.&lt;br /&gt;
&lt;br /&gt;
A Listing of properties for TaharezLook is available here [http://cegui.org.uk/wiki/Property_reference_for_TaharezLook]&lt;br /&gt;
&lt;br /&gt;
Now that we have created the window. We need to attach it to the current root window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()-&amp;gt;addChild(myImageWindow);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.System.getSingleton().getDefaultGUIContext().getRootWindow().addChild(myImageWindow)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow the Window to be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Conclusion ====&lt;br /&gt;
&lt;br /&gt;
So with this quick tutorial we got a very short introduction to PropertySet usage (Important!) and a little bit about how the Unified Dimension System in CEGUI Works. While still not terribly useful, we're beginning to understand how to use some of CEGUI's faculties. Next up, we'll learn how to get some interactivity from this thing.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Superpws</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Introduction&amp;diff=5217</id>
		<title>CEGUI In Practice - Introduction</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Introduction&amp;diff=5217"/>
				<updated>2014-03-30T07:22:27Z</updated>
		
		<summary type="html">&lt;p&gt;Superpws: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.8}}&lt;br /&gt;
{{Series|CEGUI In Practice|1}}&lt;br /&gt;
&lt;br /&gt;
== CEGUI In-Practice ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the first in a series of tutorials based on how to use CEGUI.  The majority of the tutorials will be done in code.  I may attempt to sprinkle in uses of .layouts throughout the tutorial.  But once you understand how to use many of the Widgets in code it becomes easy to use them via script.&lt;br /&gt;
&lt;br /&gt;
[Please note, I am an Ogre3d user, so the initial setup will be how to bootstrap and start with ogre3d.]&lt;br /&gt;
&lt;br /&gt;
=== Introducing CEGUI ===&lt;br /&gt;
First notes, CEGUI uses a number of Singleton classes.  These, if not experienced with singletons, allow global access to a Class globally in the code, while ensuring only a 'single'ton instance is ever created.  The following are the Singletons we will be using&lt;br /&gt;
in this example.&lt;br /&gt;
&lt;br /&gt;
'''CEGUI::{{DoxygenClass|System|0.8}}''' - The big Kahuna.  This contains many of the functions for setting and getting defaults.  &amp;lt;br /&amp;gt;&lt;br /&gt;
'''CEGUI::{{DoxygenClass|WindowManager|0.8}}''' - Manages the windows of CEGUI.  If a new window is going to be created or Deleted WindowManager is gonna be your class.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CEGUI::{{DoxygenClass|SchemeManager|0.8}}''' - Manages Schemes. &amp;lt;br /&amp;gt;&lt;br /&gt;
'''CEGUI::{{DoxygenClass|FontManager|0.8}}''' - Manages the different fonts you will use in your application. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Getting Started ====&lt;br /&gt;
&lt;br /&gt;
Let's jump in and get some stuff setup.  The first thing we need to do is get the system up and running.  Since I am an Ogre user, I will show the code to get the system up and running with ogre. There are methods of getting it started for numerous other Rendering systems.  Shown here [[The Beginner Guide to Getting CEGUI Rendering]]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Ogre3d Method is shown here:&lt;br /&gt;
&lt;br /&gt;
===== Including necessary headers =====&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;CEGUI.h&amp;gt;&lt;br /&gt;
#include &amp;lt;RendererModules/Ogre/Renderer.h&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import PyCEGUI&lt;br /&gt;
import PyCEGUIOgreRenderer&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Bootstrapping CEGUI =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::OgreRenderer* renderer = &amp;amp;CEGUI::OgreRenderer::bootstrapSystem();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
renderer = PyCEGUIOgreRenderer.OgreRenderer.bootstrapSystem()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[Note: This is a newer method using the bootstrapSystem, this was introduced in CEGUI 0.7.1.  There are examples on this wiki using older versions of CEGUI.  Please make note of which version you are using] &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code creates an instance of the Ogre3d Render interface between Ogre3d and CEGUI.  You will not need to deal with this much after the above code has been run.  This creates the link which Ogre will use to render CEGUI.  Please note, you will want to call this if Ogre is auto-creating the render window ( pretty common ).  If you are manually creating the Ogre3d window, you will need to use the ''CEGUI::OgreRenderer::bootstrapSystem(Ogre::RenderWindow *)'' overload. &lt;br /&gt;
&lt;br /&gt;
An additional point to mention is that the bootstrapSystem() will create an instance of CEGUI::System.  This is important, as if you already have created CEGUI::System, an exception will be thrown.&lt;br /&gt;
&lt;br /&gt;
==== Oh there will be scripts ====&lt;br /&gt;
&lt;br /&gt;
Now that we've called the very meager function above.  We need to cover some very basic information about CEGUI before we proceed.&lt;br /&gt;
&lt;br /&gt;
CEGUI is a VERY heavily scripted library.  Much of what defines the artistic content of CEGUI is defined in various .xml files.  The beginning script we will mention is the '''Scheme''' (*.scheme).  Every widget you will use in your GUI will be defined in the .scheme file. It will also contain information for about subscripts which will be used, described below. Later tutorials will describe this file in greater detail. Below is an example if you run across one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
&amp;lt;GUIScheme Name=&amp;quot;TaharezLook&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;Imageset Filename=&amp;quot;TaharezLook.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;Font Filename=&amp;quot;DejaVuSans-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;LookNFeel Filename=&amp;quot;TaharezLook.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;WindowRendererSet Filename=&amp;quot;CEGUIFalagardWRBase&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;FalagardMapping WindowType=&amp;quot;TaharezLook/Button&amp;quot;      TargetType=&amp;quot;CEGUI/PushButton&amp;quot;  Renderer=&amp;quot;Falagard/Button&amp;quot;       LookNFeel=&amp;quot;TaharezLook/Button&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;FalagardMapping WindowType=&amp;quot;TaharezLook/Checkbox&amp;quot;    TargetType=&amp;quot;CEGUI/Checkbox&amp;quot;    Renderer=&amp;quot;Falagard/ToggleButton&amp;quot; LookNFeel=&amp;quot;TaharezLook/Checkbox&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/GUIScheme&amp;gt;&amp;lt;/source&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next script we will mention is the '''Layouts''' (*.layout).  This is also an xml file, which defines the layout (obviously!) of the window we want to display on the screen.  For example, if we wanted a to create a Chat window, we would probably have a ChatWindow.layout file somewhere. This would describe how the window looks (How big, where on the screen its displayed, etc), where the typing box would be located within this window, and where the button to 'send' the chat message would be.  Below is a quick example of what a .layout file looks like:&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;TaharezLook/FrameWindow&amp;quot; Name=&amp;quot;ConsoleRoot&amp;quot; &amp;gt;&lt;br /&gt;
        &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Chat Window&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;DejaVuSans-10&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;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.114991,0},{0.358182,0},{0.519469,0},{0.775455,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;Window Type=&amp;quot;TaharezLook/Editbox&amp;quot; Name=&amp;quot;ConsoleRoot/EditBox&amp;quot; &amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;MaxTextLength&amp;quot; Value=&amp;quot;1073741823&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.0201637,0},{0.787097,0},{0.694549,0},{0.957693,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;TextParsingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&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;
Another script which is useful to mention is a '''Font''' (*.font). This describes fonts which will be used in cegui. Below is an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
&amp;lt;Font Name=&amp;quot;DejaVuSans-10&amp;quot; Filename=&amp;quot;DejaVuSans.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; AutoScaled=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another important script is the '''Imageset''' (*.imageset). This is the file which determines the visuals of each widget. In CEGUI the visual part of a widget which the user see's is a small X/Y coordinate on a larger texture file. For example, a basic Button will have the graphics defined in a .imageset to be a certain position on a texture image (*.png, *.bmp, *.jpg, etc) with a certain height and width. It may be located at Pixel 100x320 and be 50x50 in size. This will be defined in the imageset. Below is an example.&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; AutoScaled=&amp;quot;true&amp;quot;&amp;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;
&amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lastly, '''LookNFeel''' (*.looknfeel). This is a fairly evil looking file, and to save everyone from nightmarish horrors, I will not post an example (and to save space). This is the file which determines how every widget (CEGUI speak for window/object/item) looks and acts. For example, what it looks like when you mouse over a button, or how to build the border and background of a Window. Each scheme will generally have its own LookNFeel to allow more customization of the basic construction of CEGUI Widgets.&lt;br /&gt;
&lt;br /&gt;
==== Back to Getting Started ====&lt;br /&gt;
&lt;br /&gt;
Now that we have a minimal idea about what scripts CEGUI uses (and don't worry, they make more sense and are less intimidating as you proceede. You will likely use .layout the most in the beginning) lets start doing something useful!&lt;br /&gt;
&lt;br /&gt;
Where we left off, CEGUI was just started. But in and of itself, it doesn't know what you want to do. First thing we should do is tell it what Scheme we want to use. As mentioned above, a .Scheme contains a listing of Widget and Other scripts to include, a Scheme can include an Imageset, lookNFeel, and font to use. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// Load the scheme&lt;br /&gt;
CEGUI::SchemeManager::getSingleton().createFromFile( &amp;quot;TaharezLook.scheme&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Load the scheme&lt;br /&gt;
PyCEGUI.SchemeManager.getSingleton().createFromFile( &amp;quot;TaharezLook.scheme&amp;quot; )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wanted to use an imageset or Font which is not designated in the .Scheme file its easy to do. Simply use the associated manager to load them. Since i'm trying my best to keep this as an introductory tutorial, I'll keep to the mission and explain these managers in a later tutorial.&lt;br /&gt;
&lt;br /&gt;
Next up, lets define a few defaults:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// Set the defaults&lt;br /&gt;
CEGUI::System::getSingleton().getDefaultGUIContext().setDefaultFont(&amp;quot;DejaVuSans-10&amp;quot;);&lt;br /&gt;
CEGUI::System::getSingleton().getDefaultGUIContext().getMouseCursor().setDefaultImage(&amp;quot;TaharezLook/MouseArrow&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Set the defaults&lt;br /&gt;
PyCEGUI.System.getSingleton().getDefaultGUIContext().setDefaultFont( &amp;quot;DejaVuSans-10&amp;quot; )&lt;br /&gt;
PyCEGUI.System.getSingleton().getDefaultGUIContext().getMouseCursor().setDefaultImage(&amp;quot;TaharezLook/MouseArrow&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These calls will summon the CEGUI::System from global scope and set the DefaultFont, and the default Mouse Cursor. If you reference TaharezLook.scheme (located in the cegui/datafiles/schemes folder). You will see that it loaded a font named DejaVuSans-10.font with the &amp;lt;font&amp;gt; tag in the .scheme. The MouseArrow is found inside the imageset called &amp;quot;TharezLook&amp;quot; under the tag of &amp;quot;MouseArrow&amp;quot;. Pretty self explanetory I'd hope.&lt;br /&gt;
&lt;br /&gt;
Alright, now CEGUI knows about some basic defaults we want to use. Lets create a window which will be the Root window we will put everything on from here on out.&lt;br /&gt;
&lt;br /&gt;
CEGUI uses a Parent/Child system for organizing the windows. So the first useful thing to do is create a parent which all other windows will be the child&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window* myRoot = CEGUI::WindowManager::getSingleton().createWindow( &amp;quot;DefaultWindow&amp;quot;, &amp;quot;_MasterRoot&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myRoot = PyCEGUI.WindowManager.getSingleton().createWindow( &amp;quot;DefaultWindow&amp;quot;, &amp;quot;_MasterRoot&amp;quot; )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above function calls upon the WindowManager singleton, and creates a window of type &amp;quot;DefaultWindow&amp;quot; named &amp;quot;_MasterRoot&amp;quot;. The default window is just that. a default window, which is blank (or transparent). You can give the root window any name you like, however, i like using _MasterRoot as its unlikely any other window I ever use will have the name. &lt;br /&gt;
&lt;br /&gt;
Now that we have created the window, we need to set it as the root window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow( myRoot );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.System.getSingleton().getDefaultGUIContext().setRootWindow( myRoot )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This calls upon the system, and assigns myRoot as the default window. Recall myRoot was created above with the name &amp;quot;_MasterRoot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Conclusion ====&lt;br /&gt;
&lt;br /&gt;
While not a super exciting tutorial. At this point CEGUI is now setup, and we could begin adding windows and doing such GUI shenanigans as making windows, buttons, clicking, and fun. Later tutorials will demonstrate how to have CEGUI Recognize clicking, dragging of windows, typing, and more! Thanks for reading!&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Superpws</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Using_.layout_files&amp;diff=5216</id>
		<title>CEGUI In Practice - Using .layout files</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Using_.layout_files&amp;diff=5216"/>
				<updated>2014-03-29T19:15:33Z</updated>
		
		<summary type="html">&lt;p&gt;Superpws: /* Applying our knowledge */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.7}}&lt;br /&gt;
{{Series|CEGUI In Practice|5}}&lt;br /&gt;
&lt;br /&gt;
== CEGUI InPractice 5 ==&lt;br /&gt;
&lt;br /&gt;
In this tutorial we will introduce how to use the .layout file.  This is likely what will be used for larger scale projects, where the art team isn't going to want to wait for you to recompile the source for every change they make.&lt;br /&gt;
&lt;br /&gt;
==== Meet the Layout ====&lt;br /&gt;
&lt;br /&gt;
The Layout file (.layout) is an xml file.  There exists at least two editors for layouts.  The first one is the  [[Downloads|CEGUI LayoutEditor]] This is a fairly mature editor.  Unfortunately it is deprecated and has not received any updates in sometime.  There is a new Editor (CEGUI Layout Editor 2) which is available from the SVN.  For the usage of this tutorial tho, we will not be using an editor and will be manipulating the .layout file with a plain old text editor.&lt;br /&gt;
&lt;br /&gt;
First thing to note, is its an XML file.  So proper XML formatting is required.  Second, is that it is hierarchical just like CEGUI.  We will work towards writing a Simple Console here.  I have created a console layout, and that will be the goal of this tutorial, to make a console editor like you would find in the various MMORPG's.  This is what we'll make today:&lt;br /&gt;
&lt;br /&gt;
[[File:TutorialInPractice-Console.jpg]]&amp;lt;br /&amp;gt;&lt;br /&gt;
Attached is the layout:&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;TaharezLook/FrameWindow&amp;quot; Name=&amp;quot;ConsoleRoot&amp;quot; &amp;gt;&lt;br /&gt;
        &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Chat Window&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;DejaVuSans-10&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;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.114991,0},{0.358182,0},{0.519469,0},{0.775455,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;Window Type=&amp;quot;TaharezLook/Editbox&amp;quot; Name=&amp;quot;ConsoleRoot/EditBox&amp;quot; &amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;MaxTextLength&amp;quot; Value=&amp;quot;1073741823&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.0201637,0},{0.787097,0},{0.694549,0},{0.957693,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;TextParsingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/Window&amp;gt;&lt;br /&gt;
        &amp;lt;Window Type=&amp;quot;TaharezLook/Button&amp;quot; Name=&amp;quot;ConsoleRoot/SendButton&amp;quot; &amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Send&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.732211,0},{0.812349,0},{0.928283,0},{0.946832,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/Window&amp;gt;&lt;br /&gt;
        &amp;lt;Window Type=&amp;quot;TaharezLook/Listbox&amp;quot; Name=&amp;quot;ConsoleRoot/ChatBox&amp;quot; &amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.00534809,0},{0.0131038,0},{0.949636,0},{0.762443,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;
Okay, i'll admit. I cheated and used a LayoutEditor for this. But i'm allowed to, I know what I'm doing otherwise, so do don't back talk me and do your homework.&lt;br /&gt;
&lt;br /&gt;
Erm.  Anyway, lets look at the setup of the .layout file.&lt;br /&gt;
&lt;br /&gt;
the first line &amp;lt;xml..&amp;gt;  Is just the XML Declaration, and is not important for us.&lt;br /&gt;
&lt;br /&gt;
the next line &amp;lt;GUILayout &amp;gt;  begins the .layout file as far as CEGUI is concerned.&lt;br /&gt;
&lt;br /&gt;
Next up is: &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;Window Type=&amp;quot;TaharezLook/FrameWindow&amp;quot; Name=&amp;quot;ConsoleRoot&amp;quot; &amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
This is where the meat begins.  As you can see we're creating a window of type &amp;quot;TaharezLook/FrameWindow&amp;quot; with the name &amp;quot;ConsoleRoot.&amp;quot;  &lt;br /&gt;
&lt;br /&gt;
The next lines:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;      &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Chat Window&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;DejaVuSans-10&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;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.114991,0},{0.358182,0},{0.519469,0},{0.775455,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
change various PropertySets on that new framewindow.  It sets the font, Titlebar and the area.  These could also be done in code by calling:&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window::setProperty(&amp;quot;TitlebarFont&amp;quot;,&amp;quot;DejaVuSans-10&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.Window.setProperty(&amp;quot;TitlebarFont&amp;quot;,&amp;quot;DejaVuSans-10&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
So as you can see, the scripts can be very useful allowing us to change properties outside of the code, giving the artists a great deal of usability!&lt;br /&gt;
&lt;br /&gt;
Anyway, the next line is &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;       &amp;lt;Window Type=&amp;quot;TaharezLook/Editbox&amp;quot; Name=&amp;quot;ConsoleRoot/EditBox&amp;quot; &amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;MaxTextLength&amp;quot; Value=&amp;quot;1073741823&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.0201637,0},{0.787097,0},{0.694549,0},{0.957693,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;TextParsingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/Window&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll notice this is before the &amp;lt;/Window&amp;gt; of the ConsoleRoot, so it will be created as a child in of ConsoleRoot when the script is loaded in CEGUI. Can you tell what kind of window this will be? It will be an edit box. Thats the portion of the Console Window where the user will be able to type in what they want to say. I'm not going to go into detail about the rest of the windows, as they are pretty similar to the above examples. But &amp;quot;ConsoleRoot/SendButton&amp;quot; will be the send button, and &amp;quot;ConsoleRoot/ChatBox&amp;quot; will be where the chat messages will display to.&lt;br /&gt;
&lt;br /&gt;
[Note: As you can see I adopted the Naming scheme of Parent/Child window names. This is NOT required, but I think it helps make things easier to read on code side while debugging. You wouldn't want to just name it EditBox as that would be a pretty Common name, and may conflict with other windows you create later on in the application.]&lt;br /&gt;
&lt;br /&gt;
==== Applying our knowledge ====&lt;br /&gt;
&lt;br /&gt;
Now that we have gotten an introduction to the .layout file, we should learn how to implement this knowledge. How to get the layout file to show up in CEGUI.&lt;br /&gt;
&lt;br /&gt;
This code will load the layout into a new window:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window *newWindow = CEGUI::WindowManager::getSingleton().loadWindowLayout(&amp;quot;MyConsole.layout&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
newWindow = PyCEGUI.WindowManager.getSingleton().loadWindowLayout(&amp;quot;MyConsole.layout&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pretty self explanatory. There is something to note tho, you can add a prefix to the names in this .layout file. This would be useful if you're going to add the same .layout multiple times, because after the first load you'd get name conflicts. It would find a previous &amp;quot;ConsoleRoot&amp;quot; for example. So by calling this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window *newWindow = CEGUI::WindowManager::getSingleton().loadWindowLayout(&amp;quot;MyConsole.layout&amp;quot;,&amp;quot;second_&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
newWindow = PyCEGUI.WindowManager.getSingleton().loadWindowLayout(&amp;quot;MyConsole.layout&amp;quot;,&amp;quot;second_&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
It would append &amp;quot;second_&amp;quot; to the window names (ie. &amp;quot;second_ConsoleRoot&amp;quot;); This will prevent naming errors.&lt;br /&gt;
&lt;br /&gt;
Now if we ran this right now would we be able to see the window?&lt;br /&gt;
&lt;br /&gt;
Nope. We haven't attached it to the window hierarchy have we?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::System::getSingleton().getGUISheet()-&amp;gt;addChildWindow(newWindow);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.System.getSingleton().getGuiSheet().addChildWindow(newWindow)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
Note: This assumes that you have a GUISheet already set, otherwise this will result in a segfault!&lt;br /&gt;
&lt;br /&gt;
==== Conclusion ====&lt;br /&gt;
&lt;br /&gt;
Well we showed how to load a .layout file. So far now we know how to Start the system with Ogre, create a window and understand properties, add input, process events, and load layouts. In the next tutorial we will apply this knowledge to create a console which actually does something! Till next time.&lt;br /&gt;
&lt;br /&gt;
This list of the Window properties may be helpful in creating your .layout files: [http://www.cegui.org.uk/docs/current/namespaceCEGUI_1_1WindowProperties.html Properties]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Superpws</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Using_.layout_files&amp;diff=5215</id>
		<title>CEGUI In Practice - Using .layout files</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Using_.layout_files&amp;diff=5215"/>
				<updated>2014-03-29T19:13:05Z</updated>
		
		<summary type="html">&lt;p&gt;Superpws: /* Meet the Layout */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.7}}&lt;br /&gt;
{{Series|CEGUI In Practice|5}}&lt;br /&gt;
&lt;br /&gt;
== CEGUI InPractice 5 ==&lt;br /&gt;
&lt;br /&gt;
In this tutorial we will introduce how to use the .layout file.  This is likely what will be used for larger scale projects, where the art team isn't going to want to wait for you to recompile the source for every change they make.&lt;br /&gt;
&lt;br /&gt;
==== Meet the Layout ====&lt;br /&gt;
&lt;br /&gt;
The Layout file (.layout) is an xml file.  There exists at least two editors for layouts.  The first one is the  [[Downloads|CEGUI LayoutEditor]] This is a fairly mature editor.  Unfortunately it is deprecated and has not received any updates in sometime.  There is a new Editor (CEGUI Layout Editor 2) which is available from the SVN.  For the usage of this tutorial tho, we will not be using an editor and will be manipulating the .layout file with a plain old text editor.&lt;br /&gt;
&lt;br /&gt;
First thing to note, is its an XML file.  So proper XML formatting is required.  Second, is that it is hierarchical just like CEGUI.  We will work towards writing a Simple Console here.  I have created a console layout, and that will be the goal of this tutorial, to make a console editor like you would find in the various MMORPG's.  This is what we'll make today:&lt;br /&gt;
&lt;br /&gt;
[[File:TutorialInPractice-Console.jpg]]&amp;lt;br /&amp;gt;&lt;br /&gt;
Attached is the layout:&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;TaharezLook/FrameWindow&amp;quot; Name=&amp;quot;ConsoleRoot&amp;quot; &amp;gt;&lt;br /&gt;
        &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Chat Window&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;DejaVuSans-10&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;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.114991,0},{0.358182,0},{0.519469,0},{0.775455,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;Window Type=&amp;quot;TaharezLook/Editbox&amp;quot; Name=&amp;quot;ConsoleRoot/EditBox&amp;quot; &amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;MaxTextLength&amp;quot; Value=&amp;quot;1073741823&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.0201637,0},{0.787097,0},{0.694549,0},{0.957693,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;TextParsingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/Window&amp;gt;&lt;br /&gt;
        &amp;lt;Window Type=&amp;quot;TaharezLook/Button&amp;quot; Name=&amp;quot;ConsoleRoot/SendButton&amp;quot; &amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Send&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.732211,0},{0.812349,0},{0.928283,0},{0.946832,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/Window&amp;gt;&lt;br /&gt;
        &amp;lt;Window Type=&amp;quot;TaharezLook/Listbox&amp;quot; Name=&amp;quot;ConsoleRoot/ChatBox&amp;quot; &amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.00534809,0},{0.0131038,0},{0.949636,0},{0.762443,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;
Okay, i'll admit. I cheated and used a LayoutEditor for this. But i'm allowed to, I know what I'm doing otherwise, so do don't back talk me and do your homework.&lt;br /&gt;
&lt;br /&gt;
Erm.  Anyway, lets look at the setup of the .layout file.&lt;br /&gt;
&lt;br /&gt;
the first line &amp;lt;xml..&amp;gt;  Is just the XML Declaration, and is not important for us.&lt;br /&gt;
&lt;br /&gt;
the next line &amp;lt;GUILayout &amp;gt;  begins the .layout file as far as CEGUI is concerned.&lt;br /&gt;
&lt;br /&gt;
Next up is: &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;Window Type=&amp;quot;TaharezLook/FrameWindow&amp;quot; Name=&amp;quot;ConsoleRoot&amp;quot; &amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
This is where the meat begins.  As you can see we're creating a window of type &amp;quot;TaharezLook/FrameWindow&amp;quot; with the name &amp;quot;ConsoleRoot.&amp;quot;  &lt;br /&gt;
&lt;br /&gt;
The next lines:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;      &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Chat Window&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;DejaVuSans-10&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;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.114991,0},{0.358182,0},{0.519469,0},{0.775455,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
change various PropertySets on that new framewindow.  It sets the font, Titlebar and the area.  These could also be done in code by calling:&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window::setProperty(&amp;quot;TitlebarFont&amp;quot;,&amp;quot;DejaVuSans-10&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.Window.setProperty(&amp;quot;TitlebarFont&amp;quot;,&amp;quot;DejaVuSans-10&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
So as you can see, the scripts can be very useful allowing us to change properties outside of the code, giving the artists a great deal of usability!&lt;br /&gt;
&lt;br /&gt;
Anyway, the next line is &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;       &amp;lt;Window Type=&amp;quot;TaharezLook/Editbox&amp;quot; Name=&amp;quot;ConsoleRoot/EditBox&amp;quot; &amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;MaxTextLength&amp;quot; Value=&amp;quot;1073741823&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.0201637,0},{0.787097,0},{0.694549,0},{0.957693,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;TextParsingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/Window&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You'll notice this is before the &amp;lt;/Window&amp;gt; of the ConsoleRoot, so it will be created as a child in of ConsoleRoot when the script is loaded in CEGUI. Can you tell what kind of window this will be? It will be an edit box. Thats the portion of the Console Window where the user will be able to type in what they want to say. I'm not going to go into detail about the rest of the windows, as they are pretty similar to the above examples. But &amp;quot;ConsoleRoot/SendButton&amp;quot; will be the send button, and &amp;quot;ConsoleRoot/ChatBox&amp;quot; will be where the chat messages will display to.&lt;br /&gt;
&lt;br /&gt;
[Note: As you can see I adopted the Naming scheme of Parent/Child window names. This is NOT required, but I think it helps make things easier to read on code side while debugging. You wouldn't want to just name it EditBox as that would be a pretty Common name, and may conflict with other windows you create later on in the application.]&lt;br /&gt;
&lt;br /&gt;
==== Applying our knowledge ====&lt;br /&gt;
&lt;br /&gt;
Now that we have gotten an introduction to the .layout file, we should learn how to implement this knowledge. How to get the layout file to show up in CEGUI.&lt;br /&gt;
&lt;br /&gt;
This code will load the layout into a new window:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabs&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;C++&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window *newWindow = CEGUI::WindowManager::getSingleton().loadWindowLayout(&amp;quot;MyConsole.layout&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;Python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
newWindow = PyCEGUI.WindowManager.getSingleton().loadWindowLayout(&amp;quot;MyConsole.layout&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pretty self explanatory. There is something to note tho, you can add a prefix to the names in this .layout file. This would be useful if you're going to add the same .layout multiple times, because after the first load you'd get name conflicts. It would find a previous &amp;quot;ConsoleRoot&amp;quot; for example. So by calling this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabs&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;C++&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window *newWindow = CEGUI::WindowManager::getSingleton().loadWindowLayout(&amp;quot;MyConsole.layout&amp;quot;,&amp;quot;second_&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;Python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
newWindow = PyCEGUI.WindowManager.getSingleton().loadWindowLayout(&amp;quot;MyConsole.layout&amp;quot;,&amp;quot;second_&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&amp;gt;&lt;br /&gt;
It would append &amp;quot;second_&amp;quot; to the window names (ie. &amp;quot;second_ConsoleRoot&amp;quot;); This will prevent naming errors.&lt;br /&gt;
&lt;br /&gt;
Now if we ran this right now would we be able to see the window?&lt;br /&gt;
&lt;br /&gt;
Nope. We haven't attached it to the window hierarchy have we?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabs&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;C++&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::System::getSingleton().getGUISheet()-&amp;gt;addChildWindow(newWindow);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;Python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.System.getSingleton().getGuiSheet().addChildWindow(newWindow)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&amp;gt;&lt;br /&gt;
Note: This assumes that you have a GUISheet already set, otherwise this will result in a segfault!&lt;br /&gt;
&lt;br /&gt;
==== Conclusion ====&lt;br /&gt;
&lt;br /&gt;
Well we showed how to load a .layout file. So far now we know how to Start the system with Ogre, create a window and understand properties, add input, process events, and load layouts. In the next tutorial we will apply this knowledge to create a console which actually does something! Till next time.&lt;br /&gt;
&lt;br /&gt;
This list of the Window properties may be helpful in creating your .layout files: [http://www.cegui.org.uk/docs/current/namespaceCEGUI_1_1WindowProperties.html Properties]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Superpws</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Introduction&amp;diff=5214</id>
		<title>CEGUI In Practice - Introduction</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Introduction&amp;diff=5214"/>
				<updated>2014-03-29T14:37:09Z</updated>
		
		<summary type="html">&lt;p&gt;Superpws: /* Back to Getting Started */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.7}}&lt;br /&gt;
{{Series|CEGUI In Practice|1}}&lt;br /&gt;
&lt;br /&gt;
== CEGUI In-Practice ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the first in a series of tutorials based on how to use CEGUI.  The majority of the tutorials will be done in code.  I may attempt to sprinkle in uses of .layouts throughout the tutorial.  But once you understand how to use many of the Widgets in code it becomes easy to use them via script.&lt;br /&gt;
&lt;br /&gt;
[Please note, I am an Ogre3d user, so the initial setup will be how to bootstrap and start with ogre3d.]&lt;br /&gt;
&lt;br /&gt;
=== Introducing CEGUI ===&lt;br /&gt;
First notes, CEGUI uses a number of Singleton classes.  These, if not experienced with singletons, allow global access to a Class globally in the code, while ensuring only a 'single'ton instance is ever created.  The following are the Singletons we will be using&lt;br /&gt;
in this example.&lt;br /&gt;
&lt;br /&gt;
'''CEGUI::{{DoxygenClass|System|0.7}}''' - The big Kahuna.  This contains many of the functions for setting and getting defaults.  &amp;lt;br /&amp;gt;&lt;br /&gt;
'''CEGUI::{{DoxygenClass|WindowManager|0.7}}''' - Manages the windows of CEGUI.  If a new window is going to be created or Deleted WindowManager is gonna be your class.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CEGUI::{{DoxygenClass|SchemeManager|0.7}}''' - Manages Schemes. &amp;lt;br /&amp;gt;&lt;br /&gt;
'''CEGUI::{{DoxygenClass|FontManager|0.7}}''' - Manages the different fonts you will use in your application. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Getting Started ====&lt;br /&gt;
&lt;br /&gt;
Let's jump in and get some stuff setup.  The first thing we need to do is get the system up and running.  Since I am an Ogre user, I will show the code to get the system up and running with ogre. There are methods of getting it started for numerous other Rendering systems.  Shown here [[The Beginner Guide to Getting CEGUI Rendering]]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Ogre3d Method is shown here:&lt;br /&gt;
&lt;br /&gt;
===== Including necessary headers =====&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
#include &amp;quot;RendererModules/Ogre/CEGUIOgreRenderer.h&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import PyCEGUI&lt;br /&gt;
import PyCEGUIOgreRenderer&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Bootstrapping CEGUI =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::OgreRenderer* renderer = &amp;amp;CEGUI::OgreRenderer::bootstrapSystem();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
renderer = PyCEGUIOgreRenderer.OgreRenderer.bootstrapSystem()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[Note: This is a newer method using the bootstrapSystem, this was introduced in CEGUI 0.7.1.  There are examples on this wiki using older versions of CEGUI.  Please make note of which version you are using] &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code creates an instance of the Ogre3d Render interface between Ogre3d and CEGUI.  You will not need to deal with this much after the above code has been run.  This creates the link which Ogre will use to render CEGUI.  Please note, you will want to call this if Ogre is auto-creating the render window ( pretty common ).  If you are manually creating the Ogre3d window, you will need to use the ''CEGUI::OgreRenderer::bootstrapSystem(Ogre::RenderWindow *)'' overload. &lt;br /&gt;
&lt;br /&gt;
An additional point to mention is that the bootstrapSystem() will create an instance of CEGUI::System.  This is important, as if you already have created CEGUI::System, an exception will be thrown.&lt;br /&gt;
&lt;br /&gt;
==== Oh there will be scripts ====&lt;br /&gt;
&lt;br /&gt;
Now that we've called the very meager function above.  We need to cover some very basic information about CEGUI before we proceed.&lt;br /&gt;
&lt;br /&gt;
CEGUI is a VERY heavily scripted library.  Much of what defines the artistic content of CEGUI is defined in various .xml files.  The beginning script we will mention is the '''Scheme''' (*.scheme).  Every widget you will use in your GUI will be defined in the .scheme file. It will also contain information for about subscripts which will be used, described below. Later tutorials will describe this file in greater detail. Below is an example if you run across one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
&amp;lt;GUIScheme Name=&amp;quot;TaharezLook&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;Imageset Filename=&amp;quot;TaharezLook.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;Font Filename=&amp;quot;DejaVuSans-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;LookNFeel Filename=&amp;quot;TaharezLook.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;WindowRendererSet Filename=&amp;quot;CEGUIFalagardWRBase&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;FalagardMapping WindowType=&amp;quot;TaharezLook/Button&amp;quot;      TargetType=&amp;quot;CEGUI/PushButton&amp;quot;  Renderer=&amp;quot;Falagard/Button&amp;quot;       LookNFeel=&amp;quot;TaharezLook/Button&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;FalagardMapping WindowType=&amp;quot;TaharezLook/Checkbox&amp;quot;    TargetType=&amp;quot;CEGUI/Checkbox&amp;quot;    Renderer=&amp;quot;Falagard/ToggleButton&amp;quot; LookNFeel=&amp;quot;TaharezLook/Checkbox&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/GUIScheme&amp;gt;&amp;lt;/source&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next script we will mention is the '''Layouts''' (*.layout).  This is also an xml file, which defines the layout (obviously!) of the window we want to display on the screen.  For example, if we wanted a to create a Chat window, we would probably have a ChatWindow.layout file somewhere. This would describe how the window looks (How big, where on the screen its displayed, etc), where the typing box would be located within this window, and where the button to 'send' the chat message would be.  Below is a quick example of what a .layout file looks like:&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;TaharezLook/FrameWindow&amp;quot; Name=&amp;quot;ConsoleRoot&amp;quot; &amp;gt;&lt;br /&gt;
        &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Chat Window&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;DejaVuSans-10&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;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.114991,0},{0.358182,0},{0.519469,0},{0.775455,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;Window Type=&amp;quot;TaharezLook/Editbox&amp;quot; Name=&amp;quot;ConsoleRoot/EditBox&amp;quot; &amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;MaxTextLength&amp;quot; Value=&amp;quot;1073741823&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.0201637,0},{0.787097,0},{0.694549,0},{0.957693,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;TextParsingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&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;
Another script which is useful to mention is a '''Font''' (*.font). This describes fonts which will be used in cegui. Below is an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
&amp;lt;Font Name=&amp;quot;DejaVuSans-10&amp;quot; Filename=&amp;quot;DejaVuSans.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; AutoScaled=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another important script is the '''Imageset''' (*.imageset). This is the file which determines the visuals of each widget. In CEGUI the visual part of a widget which the user see's is a small X/Y coordinate on a larger texture file. For example, a basic Button will have the graphics defined in a .imageset to be a certain position on a texture image (*.png, *.bmp, *.jpg, etc) with a certain height and width. It may be located at Pixel 100x320 and be 50x50 in size. This will be defined in the imageset. Below is an example.&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; AutoScaled=&amp;quot;true&amp;quot;&amp;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;
&amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lastly, '''LookNFeel''' (*.looknfeel). This is a fairly evil looking file, and to save everyone from nightmarish horrors, I will not post an example (and to save space). This is the file which determines how every widget (CEGUI speak for window/object/item) looks and acts. For example, what it looks like when you mouse over a button, or how to build the border and background of a Window. Each scheme will generally have its own LookNFeel to allow more customization of the basic construction of CEGUI Widgets.&lt;br /&gt;
&lt;br /&gt;
==== Back to Getting Started ====&lt;br /&gt;
&lt;br /&gt;
Now that we have a minimal idea about what scripts CEGUI uses (and don't worry, they make more sense and are less intimidating as you proceede. You will likely use .layout the most in the beginning) lets start doing something useful!&lt;br /&gt;
&lt;br /&gt;
Where we left off, CEGUI was just started. But in and of itself, it doesn't know what you want to do. First thing we should do is tell it what Scheme we want to use. As mentioned above, a .Scheme contains a listing of Widget and Other scripts to include, a Scheme can include an Imageset, lookNFeel, and font to use. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// Load the scheme&lt;br /&gt;
CEGUI::SchemeManager::getSingleton().create( &amp;quot;TaharezLook.scheme&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Load the scheme&lt;br /&gt;
PyCEGUI.SchemeManager.getSingleton().create( &amp;quot;TaharezLook.scheme&amp;quot; )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wanted to use an imageset or Font which is not designated in the .Scheme file its easy to do. Simply use the associated manager to load them. Since i'm trying my best to keep this as an introductory tutorial, I'll keep to the mission and explain these managers in a later tutorial.&lt;br /&gt;
&lt;br /&gt;
Next up, lets define a few defaults:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// Set the defaults&lt;br /&gt;
CEGUI::System::getSingleton().setDefaultFont( &amp;quot;DejaVuSans-10&amp;quot; );&lt;br /&gt;
CEGUI::System::getSingleton().setDefaultMouseCursor( &amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Set the defaults&lt;br /&gt;
PyCEGUI.System.getSingleton().setDefaultFont( &amp;quot;DejaVuSans-10&amp;quot; )&lt;br /&gt;
PyCEGUI.System.getSingleton().setDefaultMouseCursor( &amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot; )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These calls will summon the CEGUI::System from global scope and set the DefaultFont, and the default Mouse Cursor. If you reference TaharezLook.scheme (located in the cegui/datafiles/schemes folder). You will see that it loaded a font named DejaVuSans-10.font with the &amp;lt;font&amp;gt; tag in the .scheme. The MouseArrow is found inside the imageset called &amp;quot;TharezLook&amp;quot; under the tag of &amp;quot;MouseArrow&amp;quot;. Pretty self explanetory I'd hope.&lt;br /&gt;
&lt;br /&gt;
Alright, now CEGUI knows about some basic defaults we want to use. Lets create a window which will be the Root window we will put everything on from here on out.&lt;br /&gt;
&lt;br /&gt;
CEGUI uses a Parent/Child system for organizing the windows. So the first useful thing to do is create a parent which all other windows will be the child&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window* myRoot = CEGUI::WindowManager::getSingleton().createWindow( &amp;quot;DefaultWindow&amp;quot;, &amp;quot;_MasterRoot&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myRoot = PyCEGUI.WindowManager.getSingleton().createWindow( &amp;quot;DefaultWindow&amp;quot;, &amp;quot;_MasterRoot&amp;quot; )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above function calls upon the WindowManager singleton, and creates a window of type &amp;quot;DefaultWindow&amp;quot; named &amp;quot;_MasterRoot&amp;quot;. The default window is just that. a default window, which is blank (or transparent). You can give the root window any name you like, however, i like using _MasterRoot as its unlikely any other window I ever use will have the name. &lt;br /&gt;
&lt;br /&gt;
Now that we have created the window, we need to set it as the root window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::System::getSingleton().setGUISheet( myRoot );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.System.getSingleton().setGUISheet( myRoot )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This calls upon the system, and assigns myRoot as the default window. Recall myRoot was created above with the name &amp;quot;_MasterRoot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Conclusion ====&lt;br /&gt;
&lt;br /&gt;
While not a super exciting tutorial. At this point CEGUI is now setup, and we could begin adding windows and doing such GUI shenanigans as making windows, buttons, clicking, and fun. Later tutorials will demonstrate how to have CEGUI Recognize clicking, dragging of windows, typing, and more! Thanks for reading!&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Superpws</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Introduction&amp;diff=5213</id>
		<title>CEGUI In Practice - Introduction</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Introduction&amp;diff=5213"/>
				<updated>2014-03-29T14:32:29Z</updated>
		
		<summary type="html">&lt;p&gt;Superpws: /* Bootstrapping CEGUI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.7}}&lt;br /&gt;
{{Series|CEGUI In Practice|1}}&lt;br /&gt;
&lt;br /&gt;
== CEGUI In-Practice ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the first in a series of tutorials based on how to use CEGUI.  The majority of the tutorials will be done in code.  I may attempt to sprinkle in uses of .layouts throughout the tutorial.  But once you understand how to use many of the Widgets in code it becomes easy to use them via script.&lt;br /&gt;
&lt;br /&gt;
[Please note, I am an Ogre3d user, so the initial setup will be how to bootstrap and start with ogre3d.]&lt;br /&gt;
&lt;br /&gt;
=== Introducing CEGUI ===&lt;br /&gt;
First notes, CEGUI uses a number of Singleton classes.  These, if not experienced with singletons, allow global access to a Class globally in the code, while ensuring only a 'single'ton instance is ever created.  The following are the Singletons we will be using&lt;br /&gt;
in this example.&lt;br /&gt;
&lt;br /&gt;
'''CEGUI::{{DoxygenClass|System|0.7}}''' - The big Kahuna.  This contains many of the functions for setting and getting defaults.  &amp;lt;br /&amp;gt;&lt;br /&gt;
'''CEGUI::{{DoxygenClass|WindowManager|0.7}}''' - Manages the windows of CEGUI.  If a new window is going to be created or Deleted WindowManager is gonna be your class.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CEGUI::{{DoxygenClass|SchemeManager|0.7}}''' - Manages Schemes. &amp;lt;br /&amp;gt;&lt;br /&gt;
'''CEGUI::{{DoxygenClass|FontManager|0.7}}''' - Manages the different fonts you will use in your application. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Getting Started ====&lt;br /&gt;
&lt;br /&gt;
Let's jump in and get some stuff setup.  The first thing we need to do is get the system up and running.  Since I am an Ogre user, I will show the code to get the system up and running with ogre. There are methods of getting it started for numerous other Rendering systems.  Shown here [[The Beginner Guide to Getting CEGUI Rendering]]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Ogre3d Method is shown here:&lt;br /&gt;
&lt;br /&gt;
===== Including necessary headers =====&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
#include &amp;quot;RendererModules/Ogre/CEGUIOgreRenderer.h&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import PyCEGUI&lt;br /&gt;
import PyCEGUIOgreRenderer&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Bootstrapping CEGUI =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::OgreRenderer* renderer = &amp;amp;CEGUI::OgreRenderer::bootstrapSystem();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
renderer = PyCEGUIOgreRenderer.OgreRenderer.bootstrapSystem()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[Note: This is a newer method using the bootstrapSystem, this was introduced in CEGUI 0.7.1.  There are examples on this wiki using older versions of CEGUI.  Please make note of which version you are using] &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code creates an instance of the Ogre3d Render interface between Ogre3d and CEGUI.  You will not need to deal with this much after the above code has been run.  This creates the link which Ogre will use to render CEGUI.  Please note, you will want to call this if Ogre is auto-creating the render window ( pretty common ).  If you are manually creating the Ogre3d window, you will need to use the ''CEGUI::OgreRenderer::bootstrapSystem(Ogre::RenderWindow *)'' overload. &lt;br /&gt;
&lt;br /&gt;
An additional point to mention is that the bootstrapSystem() will create an instance of CEGUI::System.  This is important, as if you already have created CEGUI::System, an exception will be thrown.&lt;br /&gt;
&lt;br /&gt;
==== Oh there will be scripts ====&lt;br /&gt;
&lt;br /&gt;
Now that we've called the very meager function above.  We need to cover some very basic information about CEGUI before we proceed.&lt;br /&gt;
&lt;br /&gt;
CEGUI is a VERY heavily scripted library.  Much of what defines the artistic content of CEGUI is defined in various .xml files.  The beginning script we will mention is the '''Scheme''' (*.scheme).  Every widget you will use in your GUI will be defined in the .scheme file. It will also contain information for about subscripts which will be used, described below. Later tutorials will describe this file in greater detail. Below is an example if you run across one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
&amp;lt;GUIScheme Name=&amp;quot;TaharezLook&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;Imageset Filename=&amp;quot;TaharezLook.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;Font Filename=&amp;quot;DejaVuSans-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;LookNFeel Filename=&amp;quot;TaharezLook.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;WindowRendererSet Filename=&amp;quot;CEGUIFalagardWRBase&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;FalagardMapping WindowType=&amp;quot;TaharezLook/Button&amp;quot;      TargetType=&amp;quot;CEGUI/PushButton&amp;quot;  Renderer=&amp;quot;Falagard/Button&amp;quot;       LookNFeel=&amp;quot;TaharezLook/Button&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;FalagardMapping WindowType=&amp;quot;TaharezLook/Checkbox&amp;quot;    TargetType=&amp;quot;CEGUI/Checkbox&amp;quot;    Renderer=&amp;quot;Falagard/ToggleButton&amp;quot; LookNFeel=&amp;quot;TaharezLook/Checkbox&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/GUIScheme&amp;gt;&amp;lt;/source&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next script we will mention is the '''Layouts''' (*.layout).  This is also an xml file, which defines the layout (obviously!) of the window we want to display on the screen.  For example, if we wanted a to create a Chat window, we would probably have a ChatWindow.layout file somewhere. This would describe how the window looks (How big, where on the screen its displayed, etc), where the typing box would be located within this window, and where the button to 'send' the chat message would be.  Below is a quick example of what a .layout file looks like:&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;TaharezLook/FrameWindow&amp;quot; Name=&amp;quot;ConsoleRoot&amp;quot; &amp;gt;&lt;br /&gt;
        &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Chat Window&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;DejaVuSans-10&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;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.114991,0},{0.358182,0},{0.519469,0},{0.775455,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;Window Type=&amp;quot;TaharezLook/Editbox&amp;quot; Name=&amp;quot;ConsoleRoot/EditBox&amp;quot; &amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;MaxTextLength&amp;quot; Value=&amp;quot;1073741823&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.0201637,0},{0.787097,0},{0.694549,0},{0.957693,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;TextParsingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&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;
Another script which is useful to mention is a '''Font''' (*.font). This describes fonts which will be used in cegui. Below is an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
&amp;lt;Font Name=&amp;quot;DejaVuSans-10&amp;quot; Filename=&amp;quot;DejaVuSans.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; AutoScaled=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another important script is the '''Imageset''' (*.imageset). This is the file which determines the visuals of each widget. In CEGUI the visual part of a widget which the user see's is a small X/Y coordinate on a larger texture file. For example, a basic Button will have the graphics defined in a .imageset to be a certain position on a texture image (*.png, *.bmp, *.jpg, etc) with a certain height and width. It may be located at Pixel 100x320 and be 50x50 in size. This will be defined in the imageset. Below is an example.&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; AutoScaled=&amp;quot;true&amp;quot;&amp;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;
&amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lastly, '''LookNFeel''' (*.looknfeel). This is a fairly evil looking file, and to save everyone from nightmarish horrors, I will not post an example (and to save space). This is the file which determines how every widget (CEGUI speak for window/object/item) looks and acts. For example, what it looks like when you mouse over a button, or how to build the border and background of a Window. Each scheme will generally have its own LookNFeel to allow more customization of the basic construction of CEGUI Widgets.&lt;br /&gt;
&lt;br /&gt;
==== Back to Getting Started ====&lt;br /&gt;
&lt;br /&gt;
Now that we have a minimal idea about what scripts CEGUI uses (and don't worry, they make more sense and are less intimidating as you proceede. You will likely use .layout the most in the beginning) lets start doing something useful!&lt;br /&gt;
&lt;br /&gt;
Where we left off, CEGUI was just started. But in and of itself, it doesn't know what you want to do. First thing we should do is tell it what Scheme we want to use. As mentioned above, a .Scheme contains a listing of Widget and Other scripts to include, a Scheme can include an Imageset, lookNFeel, and font to use. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabs&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;C++&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// Load the scheme&lt;br /&gt;
CEGUI::SchemeManager::getSingleton().create( &amp;quot;TaharezLook.scheme&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;Python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Load the scheme&lt;br /&gt;
PyCEGUI.SchemeManager.getSingleton().create( &amp;quot;TaharezLook.scheme&amp;quot; )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wanted to use an imageset or Font which is not designated in the .Scheme file its easy to do. Simply use the associated manager to load them. Since i'm trying my best to keep this as an introductory tutorial, I'll keep to the mission and explain these managers in a later tutorial.&lt;br /&gt;
&lt;br /&gt;
Next up, lets define a few defaults:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabs&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;C++&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// Set the defaults&lt;br /&gt;
CEGUI::System::getSingleton().setDefaultFont( &amp;quot;DejaVuSans-10&amp;quot; );&lt;br /&gt;
CEGUI::System::getSingleton().setDefaultMouseCursor( &amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;Python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Set the defaults&lt;br /&gt;
PyCEGUI.System.getSingleton().setDefaultFont( &amp;quot;DejaVuSans-10&amp;quot; )&lt;br /&gt;
PyCEGUI.System.getSingleton().setDefaultMouseCursor( &amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot; )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These calls will summon the CEGUI::System from global scope and set the DefaultFont, and the default Mouse Cursor. If you reference TaharezLook.scheme (located in the cegui/datafiles/schemes folder). You will see that it loaded a font named DejaVuSans-10.font with the &amp;lt;font&amp;gt; tag in the .scheme. The MouseArrow is found inside the imageset called &amp;quot;TharezLook&amp;quot; under the tag of &amp;quot;MouseArrow&amp;quot;. Pretty self explanetory I'd hope.&lt;br /&gt;
&lt;br /&gt;
Alright, now CEGUI knows about some basic defaults we want to use. Lets create a window which will be the Root window we will put everything on from here on out.&lt;br /&gt;
&lt;br /&gt;
CEGUI uses a Parent/Child system for organizing the windows. So the first useful thing to do is create a parent which all other windows will be the child&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabs&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;C++&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window* myRoot = CEGUI::WindowManager::getSingleton().createWindow( &amp;quot;DefaultWindow&amp;quot;, &amp;quot;_MasterRoot&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;Python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myRoot = PyCEGUI.WindowManager.getSingleton().createWindow( &amp;quot;DefaultWindow&amp;quot;, &amp;quot;_MasterRoot&amp;quot; )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above function calls upon the WindowManager singleton, and creates a window of type &amp;quot;DefaultWindow&amp;quot; named &amp;quot;_MasterRoot&amp;quot;. The default window is just that. a default window, which is blank (or transparent). You can give the root window any name you like, however, i like using _MasterRoot as its unlikely any other window I ever use will have the name. &lt;br /&gt;
&lt;br /&gt;
Now that we have created the window, we need to set it as the root window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabs&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;C++&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::System::getSingleton().setGUISheet( myRoot );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;Python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.System.getSingleton().setGUISheet( myRoot )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This calls upon the system, and assigns myRoot as the default window. Recall myRoot was created above with the name &amp;quot;_MasterRoot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Conclusion ====&lt;br /&gt;
&lt;br /&gt;
While not a super exciting tutorial. At this point CEGUI is now setup, and we could begin adding windows and doing such GUI shenanigans as making windows, buttons, clicking, and fun. Later tutorials will demonstrate how to have CEGUI Recognize clicking, dragging of windows, typing, and more! Thanks for reading!&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Superpws</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Introduction&amp;diff=5212</id>
		<title>CEGUI In Practice - Introduction</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Introduction&amp;diff=5212"/>
				<updated>2014-03-29T14:29:42Z</updated>
		
		<summary type="html">&lt;p&gt;Superpws: /* Including necessary headers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.7}}&lt;br /&gt;
{{Series|CEGUI In Practice|1}}&lt;br /&gt;
&lt;br /&gt;
== CEGUI In-Practice ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the first in a series of tutorials based on how to use CEGUI.  The majority of the tutorials will be done in code.  I may attempt to sprinkle in uses of .layouts throughout the tutorial.  But once you understand how to use many of the Widgets in code it becomes easy to use them via script.&lt;br /&gt;
&lt;br /&gt;
[Please note, I am an Ogre3d user, so the initial setup will be how to bootstrap and start with ogre3d.]&lt;br /&gt;
&lt;br /&gt;
=== Introducing CEGUI ===&lt;br /&gt;
First notes, CEGUI uses a number of Singleton classes.  These, if not experienced with singletons, allow global access to a Class globally in the code, while ensuring only a 'single'ton instance is ever created.  The following are the Singletons we will be using&lt;br /&gt;
in this example.&lt;br /&gt;
&lt;br /&gt;
'''CEGUI::{{DoxygenClass|System|0.7}}''' - The big Kahuna.  This contains many of the functions for setting and getting defaults.  &amp;lt;br /&amp;gt;&lt;br /&gt;
'''CEGUI::{{DoxygenClass|WindowManager|0.7}}''' - Manages the windows of CEGUI.  If a new window is going to be created or Deleted WindowManager is gonna be your class.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''CEGUI::{{DoxygenClass|SchemeManager|0.7}}''' - Manages Schemes. &amp;lt;br /&amp;gt;&lt;br /&gt;
'''CEGUI::{{DoxygenClass|FontManager|0.7}}''' - Manages the different fonts you will use in your application. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Getting Started ====&lt;br /&gt;
&lt;br /&gt;
Let's jump in and get some stuff setup.  The first thing we need to do is get the system up and running.  Since I am an Ogre user, I will show the code to get the system up and running with ogre. There are methods of getting it started for numerous other Rendering systems.  Shown here [[The Beginner Guide to Getting CEGUI Rendering]]. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Ogre3d Method is shown here:&lt;br /&gt;
&lt;br /&gt;
===== Including necessary headers =====&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
#include &amp;quot;RendererModules/Ogre/CEGUIOgreRenderer.h&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import PyCEGUI&lt;br /&gt;
import PyCEGUIOgreRenderer&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Bootstrapping CEGUI =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabs&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;C++&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;CEGUI::OgreRenderer* renderer = &amp;amp;CEGUI::OgreRenderer::bootstrapSystem();&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;Python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;renderer = PyCEGUIOgreRenderer.OgreRenderer.bootstrapSystem()&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[Note: This is a newer method using the bootstrapSystem, this was introduced in CEGUI 0.7.1.  There are examples on this wiki using older versions of CEGUI.  Please make note of which version you are using] &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above code creates an instance of the Ogre3d Render interface between Ogre3d and CEGUI.  You will not need to deal with this much after the above code has been run.  This creates the link which Ogre will use to render CEGUI.  Please note, you will want to call this if Ogre is auto-creating the render window ( pretty common ).  If you are manually creating the Ogre3d window, you will need to use the ''CEGUI::OgreRenderer::bootstrapSystem(Ogre::RenderWindow *)'' overload. &lt;br /&gt;
&lt;br /&gt;
An additional point to mention is that the bootstrapSystem() will create an instance of CEGUI::System.  This is important, as if you already have created CEGUI::System, an exception will be thrown.&lt;br /&gt;
&lt;br /&gt;
==== Oh there will be scripts ====&lt;br /&gt;
&lt;br /&gt;
Now that we've called the very meager function above.  We need to cover some very basic information about CEGUI before we proceed.&lt;br /&gt;
&lt;br /&gt;
CEGUI is a VERY heavily scripted library.  Much of what defines the artistic content of CEGUI is defined in various .xml files.  The beginning script we will mention is the '''Scheme''' (*.scheme).  Every widget you will use in your GUI will be defined in the .scheme file. It will also contain information for about subscripts which will be used, described below. Later tutorials will describe this file in greater detail. Below is an example if you run across one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
&amp;lt;GUIScheme Name=&amp;quot;TaharezLook&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;Imageset Filename=&amp;quot;TaharezLook.imageset&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;Font Filename=&amp;quot;DejaVuSans-10.font&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;LookNFeel Filename=&amp;quot;TaharezLook.looknfeel&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;WindowRendererSet Filename=&amp;quot;CEGUIFalagardWRBase&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;FalagardMapping WindowType=&amp;quot;TaharezLook/Button&amp;quot;      TargetType=&amp;quot;CEGUI/PushButton&amp;quot;  Renderer=&amp;quot;Falagard/Button&amp;quot;       LookNFeel=&amp;quot;TaharezLook/Button&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;FalagardMapping WindowType=&amp;quot;TaharezLook/Checkbox&amp;quot;    TargetType=&amp;quot;CEGUI/Checkbox&amp;quot;    Renderer=&amp;quot;Falagard/ToggleButton&amp;quot; LookNFeel=&amp;quot;TaharezLook/Checkbox&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/GUIScheme&amp;gt;&amp;lt;/source&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next script we will mention is the '''Layouts''' (*.layout).  This is also an xml file, which defines the layout (obviously!) of the window we want to display on the screen.  For example, if we wanted a to create a Chat window, we would probably have a ChatWindow.layout file somewhere. This would describe how the window looks (How big, where on the screen its displayed, etc), where the typing box would be located within this window, and where the button to 'send' the chat message would be.  Below is a quick example of what a .layout file looks like:&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;TaharezLook/FrameWindow&amp;quot; Name=&amp;quot;ConsoleRoot&amp;quot; &amp;gt;&lt;br /&gt;
        &amp;lt;Property Name=&amp;quot;Text&amp;quot; Value=&amp;quot;Chat Window&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;Property Name=&amp;quot;TitlebarFont&amp;quot; Value=&amp;quot;DejaVuSans-10&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;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.114991,0},{0.358182,0},{0.519469,0},{0.775455,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;Window Type=&amp;quot;TaharezLook/Editbox&amp;quot; Name=&amp;quot;ConsoleRoot/EditBox&amp;quot; &amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;MaxTextLength&amp;quot; Value=&amp;quot;1073741823&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;UnifiedAreaRect&amp;quot; Value=&amp;quot;{{0.0201637,0},{0.787097,0},{0.694549,0},{0.957693,0}}&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;Property Name=&amp;quot;TextParsingEnabled&amp;quot; Value=&amp;quot;False&amp;quot; /&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;
Another script which is useful to mention is a '''Font''' (*.font). This describes fonts which will be used in cegui. Below is an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; ?&amp;gt;&lt;br /&gt;
&amp;lt;Font Name=&amp;quot;DejaVuSans-10&amp;quot; Filename=&amp;quot;DejaVuSans.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; AutoScaled=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another important script is the '''Imageset''' (*.imageset). This is the file which determines the visuals of each widget. In CEGUI the visual part of a widget which the user see's is a small X/Y coordinate on a larger texture file. For example, a basic Button will have the graphics defined in a .imageset to be a certain position on a texture image (*.png, *.bmp, *.jpg, etc) with a certain height and width. It may be located at Pixel 100x320 and be 50x50 in size. This will be defined in the imageset. Below is an example.&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; AutoScaled=&amp;quot;true&amp;quot;&amp;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;
&amp;lt;/Imageset&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lastly, '''LookNFeel''' (*.looknfeel). This is a fairly evil looking file, and to save everyone from nightmarish horrors, I will not post an example (and to save space). This is the file which determines how every widget (CEGUI speak for window/object/item) looks and acts. For example, what it looks like when you mouse over a button, or how to build the border and background of a Window. Each scheme will generally have its own LookNFeel to allow more customization of the basic construction of CEGUI Widgets.&lt;br /&gt;
&lt;br /&gt;
==== Back to Getting Started ====&lt;br /&gt;
&lt;br /&gt;
Now that we have a minimal idea about what scripts CEGUI uses (and don't worry, they make more sense and are less intimidating as you proceede. You will likely use .layout the most in the beginning) lets start doing something useful!&lt;br /&gt;
&lt;br /&gt;
Where we left off, CEGUI was just started. But in and of itself, it doesn't know what you want to do. First thing we should do is tell it what Scheme we want to use. As mentioned above, a .Scheme contains a listing of Widget and Other scripts to include, a Scheme can include an Imageset, lookNFeel, and font to use. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabs&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;C++&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// Load the scheme&lt;br /&gt;
CEGUI::SchemeManager::getSingleton().create( &amp;quot;TaharezLook.scheme&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;Python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Load the scheme&lt;br /&gt;
PyCEGUI.SchemeManager.getSingleton().create( &amp;quot;TaharezLook.scheme&amp;quot; )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you wanted to use an imageset or Font which is not designated in the .Scheme file its easy to do. Simply use the associated manager to load them. Since i'm trying my best to keep this as an introductory tutorial, I'll keep to the mission and explain these managers in a later tutorial.&lt;br /&gt;
&lt;br /&gt;
Next up, lets define a few defaults:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabs&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;C++&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// Set the defaults&lt;br /&gt;
CEGUI::System::getSingleton().setDefaultFont( &amp;quot;DejaVuSans-10&amp;quot; );&lt;br /&gt;
CEGUI::System::getSingleton().setDefaultMouseCursor( &amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;Python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Set the defaults&lt;br /&gt;
PyCEGUI.System.getSingleton().setDefaultFont( &amp;quot;DejaVuSans-10&amp;quot; )&lt;br /&gt;
PyCEGUI.System.getSingleton().setDefaultMouseCursor( &amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot; )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These calls will summon the CEGUI::System from global scope and set the DefaultFont, and the default Mouse Cursor. If you reference TaharezLook.scheme (located in the cegui/datafiles/schemes folder). You will see that it loaded a font named DejaVuSans-10.font with the &amp;lt;font&amp;gt; tag in the .scheme. The MouseArrow is found inside the imageset called &amp;quot;TharezLook&amp;quot; under the tag of &amp;quot;MouseArrow&amp;quot;. Pretty self explanetory I'd hope.&lt;br /&gt;
&lt;br /&gt;
Alright, now CEGUI knows about some basic defaults we want to use. Lets create a window which will be the Root window we will put everything on from here on out.&lt;br /&gt;
&lt;br /&gt;
CEGUI uses a Parent/Child system for organizing the windows. So the first useful thing to do is create a parent which all other windows will be the child&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabs&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;C++&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window* myRoot = CEGUI::WindowManager::getSingleton().createWindow( &amp;quot;DefaultWindow&amp;quot;, &amp;quot;_MasterRoot&amp;quot; );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;Python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myRoot = PyCEGUI.WindowManager.getSingleton().createWindow( &amp;quot;DefaultWindow&amp;quot;, &amp;quot;_MasterRoot&amp;quot; )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The above function calls upon the WindowManager singleton, and creates a window of type &amp;quot;DefaultWindow&amp;quot; named &amp;quot;_MasterRoot&amp;quot;. The default window is just that. a default window, which is blank (or transparent). You can give the root window any name you like, however, i like using _MasterRoot as its unlikely any other window I ever use will have the name. &lt;br /&gt;
&lt;br /&gt;
Now that we have created the window, we need to set it as the root window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabs&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;C++&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::System::getSingleton().setGUISheet( myRoot );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&amp;quot;Python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.System.getSingleton().setGUISheet( myRoot )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This calls upon the system, and assigns myRoot as the default window. Recall myRoot was created above with the name &amp;quot;_MasterRoot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==== Conclusion ====&lt;br /&gt;
&lt;br /&gt;
While not a super exciting tutorial. At this point CEGUI is now setup, and we could begin adding windows and doing such GUI shenanigans as making windows, buttons, clicking, and fun. Later tutorials will demonstrate how to have CEGUI Recognize clicking, dragging of windows, typing, and more! Thanks for reading!&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Superpws</name></author>	</entry>

	<entry>
		<id>http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Creating_widgets&amp;diff=5211</id>
		<title>CEGUI In Practice - Creating widgets</title>
		<link rel="alternate" type="text/html" href="http://cegui.org.uk/wiki/index.php?title=CEGUI_In_Practice_-_Creating_widgets&amp;diff=5211"/>
				<updated>2014-03-29T14:03:42Z</updated>
		
		<summary type="html">&lt;p&gt;Superpws: /* The Unified Dimension System */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{VersionBadge|0.7}}&lt;br /&gt;
{{Series|CEGUI In Practice|2}}&lt;br /&gt;
&lt;br /&gt;
== CEGUI In-Practice 2 ==&lt;br /&gt;
&lt;br /&gt;
Welcome back.  This is the second installment of CEGUI In-Practice tutorial series.  In this we will build upon the previous tutorial, [[CEGUI In Practice - Introduction]].  We will show how to create Widgets and manage them.&lt;br /&gt;
&lt;br /&gt;
=== The Widget ===&lt;br /&gt;
&lt;br /&gt;
In the last example we showed how to bootstrap the system with Ogre, and gave a brief introduction to CEGUI's script files.  Now we will work on understanding what a widget is and how to use them.  Lets jump in and create a window which will display a box with an image in the middle of the screen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::Window *myImageWindow = CEGUI::WindowManager::getSingleton().createWindow(&amp;quot;TaharezLook/StaticImage&amp;quot;,&amp;quot;PrettyWindow&amp;quot; ); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow = PyCEGUI.WindowManager.getSingleton().createWindow(&amp;quot;TaharezLook/StaticImage&amp;quot;,&amp;quot;PrettyWindow&amp;quot; )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CEGUI uses numerous derived classes code-side to create windows.  The base class CEGUI::Window is the generic window. the CEGUI::WindowManager calls a factory class when creating a window which returns the windows pointer. The first argument, &amp;quot;TaharezLook/StaticImage&amp;quot; tells the factory what kind of window to make.  These windows are defined in .scheme, which are subsequently defined more depth in other .xml files. The second argument is the name which the window will have.  &lt;br /&gt;
&lt;br /&gt;
[Note: As a point to note, there is no strict requirement on naming of windows, except to avoid repeat names.  Some users tend to prefer a naming convention using ParentName/ChildName.  ie.  &amp;quot;ConsoleWindow/SendButton&amp;quot; or &amp;quot;_MasterRoot/HealthBar&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
Once we have created the window, myImageWindow will be a pointer to a CEGUI::{{DoxygenClass|DefaultWindow|0.7}} which is derived from CEGUI::{{DoxygenClass|Window|0.7}}. If you look in the .scheme file you can see can see what a Widget is derived from via the TargetType= tag.&lt;br /&gt;
&lt;br /&gt;
Next we need to set some properties for this window. There are two ways of doing this. The first is via the propertyset, or the second way by calling the function. The latter way can be more annoying at times, as you may have to cast the window to the correct type to get access to the member functions, but may be more intuitive depending on how you think.&lt;br /&gt;
&lt;br /&gt;
=== The Unified Dimension System ===&lt;br /&gt;
&lt;br /&gt;
We created our widget, now we need to position it and define its size. Lets do that via code shall we?&lt;br /&gt;
&lt;br /&gt;
Before we jump in too far, we need to understand how CEGUI Handles positions. CEGUI Uses a Unified Dimension system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::UDim(scale,offset);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.UDim(scale,offset)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first number is the relative point on the screen between (0,1). So if we were looking at the X axis (left to right on the screen) a UDim(0.5,0) would be Halfway across the screen with zero pixels offset. Udim(0.0,50) would be starting at the left side of the screen +50 pixels. You can combine them too Udim(0.75,10) would be 3/4 of the way across the screen, with an additional 10 pixels.&lt;br /&gt;
&lt;br /&gt;
A point on the screen (or a UVector2) is made up of two UDims:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::UVector2(UDim x,UDim y);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.UVector2(UDim x, UDim y)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As such, a CEGUI::Rect is as you would imagine, 4 UDims&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::URect(CEGUI::Udim left,CEGUI::Udim top,CEGUI::Udim right,CEGUI::Udim bottom);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.URect(PyCEGUI.Udim left, PyCEGUI.Udim top, PyCEGUI.Udim right, PyCEGUI.Udim bottom)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So now that we know how positions are done, lets move our created window to the middle of the screen:&lt;br /&gt;
==== The Widget in Practice ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow-&amp;gt;setPosition(CEGUI::UVector2(CEGUI::UDim(0.5,0),CEGUI::UDim(0.5,0)));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow.setPosition(PyCEGUI.UVector2(PyCEGUI.UDim(0.5,0), PyCEGUI.UDim(0.5,0)))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That may look a little ugly but break it down. setPosition takes a UVector2, and each UVector2 is made up of an X and Y Udim, which is made up of a Scale and Absolute float. &lt;br /&gt;
&lt;br /&gt;
So, we have moved our window to the middle of the screen.. but CEGUI doesn't know how big to make it? So set its size to 150 pixels by 100 pixels [Note: I dropped the namespace for this to increase readability]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow-&amp;gt;setSize(UVector2(UDim(0,150),UDim(0,100)));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow.setSize(UVector2(UDim(0,150),UDim(0,100)));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case we specified the Udim using 0 for scales, and the actual pixel size in the absolute argument. The Absolute argument is additive to the scale, and in this case we didn't want to have the size be affected by the scale argument. If we were creating a splash screen that took up the entire window, we would likely want the size to be UVector2(UDim(1,0),UDim(1,0) with the position being at UVector2(Udim(0,0), UDim(0,0).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now that we have created the window to the size we want. We need to tell it what image to display! That we will do by using the PropertySet as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow-&amp;gt;setProperty(&amp;quot;Image&amp;quot;,&amp;quot;set:TaharezLook image:full_image&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
myImageWindow.setProperty(&amp;quot;Image&amp;quot;,&amp;quot;set:TaharezLook image:full_image&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first agument is what Property we want to set, and the second argument is what value to set. The second argument is a string broken into two pieces in this example. We need to know what ImageSet we are looking in, which is referenced following the 'set:' portion. And then the image via the 'image:' portion. In this case we want it to show the full_image.&lt;br /&gt;
&lt;br /&gt;
A Listing of properties for TaharezLook is available here [http://cegui.org.uk/static/TaharezLookProperties.html]&lt;br /&gt;
&lt;br /&gt;
Now that we have created the window. We need to attach it to the current root window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tabber&amp;gt;&lt;br /&gt;
C++=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CEGUI::System::getSingleton().getGUISheet()-&amp;gt;addChildWindow(myImageWindow);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|-|&lt;br /&gt;
Python=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
PyCEGUI.System.getSingleton().getGUISheet().addChildWindow(myImageWindow)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/tabber&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow the Window to be displayed.&lt;br /&gt;
&lt;br /&gt;
==== Conclusion ====&lt;br /&gt;
&lt;br /&gt;
So with this quick tutorial we got a very short introduction to PropertySet usage (Important!) and a little bit about how the Unified Dimension System in CEGUI Works. While still not terribly useful, we're beginning to understand how to use some of CEGUI's faculties. Next up, we'll learn how to get some interactivity from this thing.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Superpws</name></author>	</entry>

	</feed>