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

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Build_PyCEGUI_from_source_for_Linux&amp;diff=4558</id>
		<title>Build PyCEGUI from source for Linux</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Build_PyCEGUI_from_source_for_Linux&amp;diff=4558"/>
				<updated>2011-07-06T20:02:37Z</updated>
		
		<summary type="html">&lt;p&gt;Snizzo: added category howto&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Ubuntu 11.04 =&lt;br /&gt;
Version shipped in repositories is 6.0 so if we want 7.x we need to build it from source.&lt;br /&gt;
&lt;br /&gt;
* Install dependency packages: &amp;lt;code&amp;gt;sudo apt-get install build-essential pkg-config python-dev libfreetype6-dev libpcre3-dev libboost-python-dev libglut3-dev libpng-dev libmng-dev libjpeg-dev libfreeimage-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
* Obtain a copy of CEGUI [http://prdownloads.sourceforge.net/crayzedsgui/CEGUI-0.7.5.tar.gz?download here]&lt;br /&gt;
* Extract to a folder&lt;br /&gt;
* Before we build, we have to symlink the site-packages directory correctly, so it installs to the correct place. &lt;br /&gt;
 sudo rmdir /usr/local/lib/python2.6/site-packages&lt;br /&gt;
 sudo ln -s /usr/local/lib/python2.6/dist-packages/ /usr/local/lib/python2.6/site-packages&lt;br /&gt;
* Build CEGUI with python support&lt;br /&gt;
 ./configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; sudo make install &amp;amp;&amp;amp; sudo ldconfig&lt;br /&gt;
* ''Note: On some Ubuntu systems it seems that CEGUI's configure system does not correctly detect the Python headers. To solve this, do the following:''&lt;br /&gt;
 export CXXFLAGS=-I/usr/include/python2.6&lt;br /&gt;
 ./configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; sudo make install &amp;amp;&amp;amp; sudo ldconfig&lt;br /&gt;
&lt;br /&gt;
= Still not working? =&lt;br /&gt;
You can try running your program with:&lt;br /&gt;
 PYTHONPATH=&amp;quot;/usr/local/lib/python2.7/site-packages:$PYTHONPATH&amp;quot; python &amp;lt;file.py&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note for Panda3D users'''&lt;br /&gt;
You can run your program at the same way, using:&lt;br /&gt;
 PYTHONPATH=&amp;quot;/usr/local/lib/python2.7/site-packages:$PYTHONPATH&amp;quot; ppython &amp;lt;file.py&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Snizzo</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Build_PyCEGUI_from_source_for_Linux&amp;diff=4557</id>
		<title>Build PyCEGUI from source for Linux</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Build_PyCEGUI_from_source_for_Linux&amp;diff=4557"/>
				<updated>2011-07-06T19:55:11Z</updated>
		
		<summary type="html">&lt;p&gt;Snizzo: /* Still not working? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Ubuntu 11.04 =&lt;br /&gt;
Version shipped in repositories is 6.0 so if we want 7.x we need to build it from source.&lt;br /&gt;
&lt;br /&gt;
* Install dependency packages: &amp;lt;code&amp;gt;sudo apt-get install build-essential pkg-config python-dev libfreetype6-dev libpcre3-dev libboost-python-dev libglut3-dev libpng-dev libmng-dev libjpeg-dev libfreeimage-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
* Obtain a copy of CEGUI [http://prdownloads.sourceforge.net/crayzedsgui/CEGUI-0.7.5.tar.gz?download here]&lt;br /&gt;
* Extract to a folder&lt;br /&gt;
* Before we build, we have to symlink the site-packages directory correctly, so it installs to the correct place. &lt;br /&gt;
 sudo rmdir /usr/local/lib/python2.6/site-packages&lt;br /&gt;
 sudo ln -s /usr/local/lib/python2.6/dist-packages/ /usr/local/lib/python2.6/site-packages&lt;br /&gt;
* Build CEGUI with python support&lt;br /&gt;
 ./configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; sudo make install &amp;amp;&amp;amp; sudo ldconfig&lt;br /&gt;
* ''Note: On some Ubuntu systems it seems that CEGUI's configure system does not correctly detect the Python headers. To solve this, do the following:''&lt;br /&gt;
 export CXXFLAGS=-I/usr/include/python2.6&lt;br /&gt;
 ./configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; sudo make install &amp;amp;&amp;amp; sudo ldconfig&lt;br /&gt;
&lt;br /&gt;
= Still not working? =&lt;br /&gt;
You can try running your program with:&lt;br /&gt;
 PYTHONPATH=&amp;quot;/usr/local/lib/python2.7/site-packages:$PYTHONPATH&amp;quot; python &amp;lt;file.py&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note for Panda3D users'''&lt;br /&gt;
You can run your program at the same way, using:&lt;br /&gt;
 PYTHONPATH=&amp;quot;/usr/local/lib/python2.7/site-packages:$PYTHONPATH&amp;quot; ppython &amp;lt;file.py&amp;gt;&lt;/div&gt;</summary>
		<author><name>Snizzo</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Build_PyCEGUI_from_source_for_Linux&amp;diff=4556</id>
		<title>Build PyCEGUI from source for Linux</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Build_PyCEGUI_from_source_for_Linux&amp;diff=4556"/>
				<updated>2011-07-06T19:54:48Z</updated>
		
		<summary type="html">&lt;p&gt;Snizzo: creating page for ubuntu users&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Ubuntu 11.04 =&lt;br /&gt;
Version shipped in repositories is 6.0 so if we want 7.x we need to build it from source.&lt;br /&gt;
&lt;br /&gt;
* Install dependency packages: &amp;lt;code&amp;gt;sudo apt-get install build-essential pkg-config python-dev libfreetype6-dev libpcre3-dev libboost-python-dev libglut3-dev libpng-dev libmng-dev libjpeg-dev libfreeimage-dev&amp;lt;/code&amp;gt;&lt;br /&gt;
* Obtain a copy of CEGUI [http://prdownloads.sourceforge.net/crayzedsgui/CEGUI-0.7.5.tar.gz?download here]&lt;br /&gt;
* Extract to a folder&lt;br /&gt;
* Before we build, we have to symlink the site-packages directory correctly, so it installs to the correct place. &lt;br /&gt;
 sudo rmdir /usr/local/lib/python2.6/site-packages&lt;br /&gt;
 sudo ln -s /usr/local/lib/python2.6/dist-packages/ /usr/local/lib/python2.6/site-packages&lt;br /&gt;
* Build CEGUI with python support&lt;br /&gt;
 ./configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; sudo make install &amp;amp;&amp;amp; sudo ldconfig&lt;br /&gt;
* ''Note: On some Ubuntu systems it seems that CEGUI's configure system does not correctly detect the Python headers. To solve this, do the following:''&lt;br /&gt;
 export CXXFLAGS=-I/usr/include/python2.6&lt;br /&gt;
 ./configure &amp;amp;&amp;amp; make &amp;amp;&amp;amp; sudo make install &amp;amp;&amp;amp; sudo ldconfig&lt;br /&gt;
&lt;br /&gt;
= Still not working? =&lt;br /&gt;
You can try running your programs with:&lt;br /&gt;
 PYTHONPATH=&amp;quot;/usr/local/lib/python2.7/site-packages:$PYTHONPATH&amp;quot; python &amp;lt;file.py&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note for Panda3D users'''&lt;br /&gt;
You can run your programs at the same way, using:&lt;br /&gt;
 PYTHONPATH=&amp;quot;/usr/local/lib/python2.7/site-packages:$PYTHONPATH&amp;quot; ppython &amp;lt;file.py&amp;gt;&lt;/div&gt;</summary>
		<author><name>Snizzo</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=CEGUI_In_Practice_-_Creating_widgets&amp;diff=4358</id>
		<title>CEGUI In Practice - Creating widgets</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=CEGUI_In_Practice_-_Creating_widgets&amp;diff=4358"/>
				<updated>2011-03-12T20:55:33Z</updated>
		
		<summary type="html">&lt;p&gt;Snizzo: &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;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 *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;
&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;
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;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&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;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::UDim(scale,offset);&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.UDim(scale,offset)&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;
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;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::UVector2(UDim x,UDim y);&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.UVector2(UDim x, UDim y)&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;
As such, a CEGUI::Rect is as you would imagine, 4 UDims&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::URect(CEGUI::Udim left,CEGUI::Udim top,CEGUI::Udim right,CEGUI::Udim bottom);&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.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;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&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;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;
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;
&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;
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;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&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;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;
myImageWindow-&amp;gt;setSize(UVector2(UDim(0,150),UDim(0,100)));&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;
myImageWindow.setSize(UVector2(UDim(0,150),UDim(0,100)));&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;
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;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;
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;
&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;
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;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&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;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::getGUISheet()-&amp;gt;addChildWindow(myImageWindow);&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.getGUISheet().addChildWindow(myImageWindow)&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 will allow the Window to be displayed.&lt;br /&gt;
&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>Snizzo</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=CEGUI_In_Practice_-_Creating_widgets&amp;diff=4357</id>
		<title>CEGUI In Practice - Creating widgets</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=CEGUI_In_Practice_-_Creating_widgets&amp;diff=4357"/>
				<updated>2011-03-12T20:53:19Z</updated>
		
		<summary type="html">&lt;p&gt;Snizzo: added python code&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;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 *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;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&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;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&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;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::UDim(scale,offset);&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;
PyCEGUI.UDim(scale,offset)&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&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;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::UVector2(UDim x,UDim y);&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;
PyCEGUI.UVector2(UDim x, UDim y)&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&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;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::URect(CEGUI::Udim left,CEGUI::Udim top,CEGUI::Udim right,CEGUI::Udim bottom);&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;
PyCEGUI.URect(PyCEGUI.Udim left, PyCEGUI.Udim top, PyCEGUI.Udim right, PyCEGUI.Udim bottom)&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&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;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;
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;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&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;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&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;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;
myImageWindow-&amp;gt;setSize(UVector2(UDim(0,150),UDim(0,100)));&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;
myImageWindow.setSize(UVector2(UDim(0,150),UDim(0,100)));&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&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;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;
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;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;tab title=&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;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&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;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::getGUISheet()-&amp;gt;addChildWindow(myImageWindow);&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;
PyCEGUI.System.getGUISheet().addChildWindow(myImageWindow)&lt;br /&gt;
&amp;lt;/tab&amp;gt;&lt;br /&gt;
&amp;lt;/tabs&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will allow the Window to be displayed.&lt;br /&gt;
&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>Snizzo</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=CEGUI_In_Practice_-_Introduction&amp;diff=4355</id>
		<title>CEGUI In Practice - Introduction</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=CEGUI_In_Practice_-_Introduction&amp;diff=4355"/>
				<updated>2011-03-12T20:18:03Z</updated>
		
		<summary type="html">&lt;p&gt;Snizzo: &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;
Lets 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;
&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;
&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;
And 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, and will 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;&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;&amp;lt;/source&amp;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;
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;
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 Scheem 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>Snizzo</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=CEGUI_In_Practice_-_Introduction&amp;diff=4354</id>
		<title>CEGUI In Practice - Introduction</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=CEGUI_In_Practice_-_Introduction&amp;diff=4354"/>
				<updated>2011-03-12T20:13:26Z</updated>
		
		<summary type="html">&lt;p&gt;Snizzo: &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;
Lets 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;
&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;
&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;
And 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, and will 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;&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;&amp;lt;/source&amp;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;
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;
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 Scheem 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;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;
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;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;
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;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;
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>Snizzo</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=CEGUI_In_Practice_-_Introduction&amp;diff=4353</id>
		<title>CEGUI In Practice - Introduction</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=CEGUI_In_Practice_-_Introduction&amp;diff=4353"/>
				<updated>2011-03-12T20:11:41Z</updated>
		
		<summary type="html">&lt;p&gt;Snizzo: &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;
Lets 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;
&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;
&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;
And 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, and will 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;&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;&amp;lt;/source&amp;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;
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;
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 Scheem 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;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;
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;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;
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;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;
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>Snizzo</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=CEGUI_In_Practice_-_Introduction&amp;diff=4352</id>
		<title>CEGUI In Practice - Introduction</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=CEGUI_In_Practice_-_Introduction&amp;diff=4352"/>
				<updated>2011-03-12T20:07:09Z</updated>
		
		<summary type="html">&lt;p&gt;Snizzo: &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;
Lets 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;
&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;
&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;
And 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, and will 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;&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;&amp;lt;/source&amp;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;
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;
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 Scheem can include an Imageset, looknFeel, and font to use. &lt;br /&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;
&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;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;
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;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;
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;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;
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>Snizzo</name></author>	</entry>

	</feed>