<?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=Hawkeyenl</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=Hawkeyenl"/>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/Special:Contributions/Hawkeyenl"/>
		<updated>2026-08-11T01:20:36Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Creating_a_sub_image&amp;diff=2183</id>
		<title>Creating a sub image</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Creating_a_sub_image&amp;diff=2183"/>
				<updated>2006-05-28T18:09:10Z</updated>
		
		<summary type="html">&lt;p&gt;Hawkeyenl: CodeSnippets/CreateSubImage moved to CreateSubImage&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Creating a subimage==&lt;br /&gt;
I found that it might be usefull to be able to create a subimage from an image. Say for instance u have a minimap created from a file, and you want to be able to zoom it. For this purpose it's best to use a subimage from the map. Basically this code can be used to complete that task:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//this function is just called to show the imageloading from a file, and selecting a subpart of the image&lt;br /&gt;
void GUIHud::createMMap()&lt;br /&gt;
{&lt;br /&gt;
	//load in a file, replace with your own file&lt;br /&gt;
	CEGUI::Texture* texture = mGUIRenderer-&amp;gt;createTexture(&amp;quot;Ground1.bmp&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	//create a new imageset with an image that spans the entire texture&lt;br /&gt;
	CEGUI::Imageset* set = CEGUI::ImagesetManager::getSingleton().createImageset((CEGUI::utf8*)&amp;quot;ExampleImageSet&amp;quot;,texture);&lt;br /&gt;
	set-&amp;gt;defineImage(&amp;quot;Base&amp;quot;,CEGUI::Point(0.0f,0.0f),CEGUI::Size(texture-&amp;gt;getWidth(),texture-&amp;gt;getHeight()),CEGUI::Point(0.0f,0.0f));&lt;br /&gt;
&lt;br /&gt;
	//create a new window for this stuff and link the created image to it&lt;br /&gt;
	CEGUI::StaticImage* renderTarget = (CEGUI::StaticImage*)CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)&amp;quot;SEM/StaticImage&amp;quot;, (CEGUI::utf8*)&amp;quot;BaseWindow&amp;quot;);&lt;br /&gt;
	renderTarget-&amp;gt;setSize(CEGUI::Size(0.3f, 0.4f));&lt;br /&gt;
	CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)topElement)-&amp;gt;addChildWindow(renderTarget);&lt;br /&gt;
        renderTarget-&amp;gt;setPosition(CEGUI::Point(0.6, 0.6));&lt;br /&gt;
	renderTarget-&amp;gt;setImage(&amp;amp;set-&amp;gt;getImage((CEGUI::utf8*)&amp;quot;Base&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	/*this function replaces the image with the new coordinates passed with it, which selects a subimage,&lt;br /&gt;
	  and replaces the given image with the newly created one */&lt;br /&gt;
	createSubImage(&amp;quot;ExampleImageSet&amp;quot;,&amp;quot;Base&amp;quot;,CEGUI::Point(0.0f,0.0f),CEGUI::Size(texture-&amp;gt;getWidth()-512,texture-&amp;gt;getHeight()-512),CEGUI::Point(0.0f,0.0f));&lt;br /&gt;
	&lt;br /&gt;
	//should not be necessary, if anything weird appears try redrawing the image&lt;br /&gt;
	//renderTarget-&amp;gt;requestRedraw();&lt;br /&gt;
}&lt;br /&gt;
//this function replaces the image in the given imageset with the new coordinates that are passed with this function&lt;br /&gt;
void GUIHud::createSubImage(CEGUI::String imageSetName,CEGUI::String imageName, CEGUI::Point start, CEGUI::Size size,CEGUI::Point offset)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Imageset* curr_imageset = CEGUI::ImagesetManager::getSingleton().getImageset(imageSetName);&lt;br /&gt;
	CEGUI::Texture* texture = curr_imageset-&amp;gt;getTexture();&lt;br /&gt;
	curr_imageset-&amp;gt;undefineImage(imageName);&lt;br /&gt;
	curr_imageset-&amp;gt;defineImage(imageName,start,size,offset);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this code was written with Ogre, but the main lines of it should be clear i think.&lt;/div&gt;</summary>
		<author><name>Hawkeyenl</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=CodeSnippets/CreateSubImage&amp;diff=2184</id>
		<title>CodeSnippets/CreateSubImage</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=CodeSnippets/CreateSubImage&amp;diff=2184"/>
				<updated>2006-05-28T18:09:10Z</updated>
		
		<summary type="html">&lt;p&gt;Hawkeyenl: CodeSnippets/CreateSubImage moved to CreateSubImage&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#redirect [[CreateSubImage]]&lt;/div&gt;</summary>
		<author><name>Hawkeyenl</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Creating_a_sub_image&amp;diff=2182</id>
		<title>Creating a sub image</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Creating_a_sub_image&amp;diff=2182"/>
				<updated>2006-05-28T18:04:13Z</updated>
		
		<summary type="html">&lt;p&gt;Hawkeyenl: /* Creating a subimage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Creating a subimage==&lt;br /&gt;
I found that it might be usefull to be able to create a subimage from an image. Say for instance u have a minimap created from a file, and you want to be able to zoom it. For this purpose it's best to use a subimage from the map. Basically this code can be used to complete that task:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//this function is just called to show the imageloading from a file, and selecting a subpart of the image&lt;br /&gt;
void GUIHud::createMMap()&lt;br /&gt;
{&lt;br /&gt;
	//load in a file, replace with your own file&lt;br /&gt;
	CEGUI::Texture* texture = mGUIRenderer-&amp;gt;createTexture(&amp;quot;Ground1.bmp&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	//create a new imageset with an image that spans the entire texture&lt;br /&gt;
	CEGUI::Imageset* set = CEGUI::ImagesetManager::getSingleton().createImageset((CEGUI::utf8*)&amp;quot;ExampleImageSet&amp;quot;,texture);&lt;br /&gt;
	set-&amp;gt;defineImage(&amp;quot;Base&amp;quot;,CEGUI::Point(0.0f,0.0f),CEGUI::Size(texture-&amp;gt;getWidth(),texture-&amp;gt;getHeight()),CEGUI::Point(0.0f,0.0f));&lt;br /&gt;
&lt;br /&gt;
	//create a new window for this stuff and link the created image to it&lt;br /&gt;
	CEGUI::StaticImage* renderTarget = (CEGUI::StaticImage*)CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)&amp;quot;SEM/StaticImage&amp;quot;, (CEGUI::utf8*)&amp;quot;BaseWindow&amp;quot;);&lt;br /&gt;
	renderTarget-&amp;gt;setSize(CEGUI::Size(0.3f, 0.4f));&lt;br /&gt;
	CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)topElement)-&amp;gt;addChildWindow(renderTarget);&lt;br /&gt;
        renderTarget-&amp;gt;setPosition(CEGUI::Point(0.6, 0.6));&lt;br /&gt;
	renderTarget-&amp;gt;setImage(&amp;amp;set-&amp;gt;getImage((CEGUI::utf8*)&amp;quot;Base&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	/*this function replaces the image with the new coordinates passed with it, which selects a subimage,&lt;br /&gt;
	  and replaces the given image with the newly created one */&lt;br /&gt;
	createSubImage(&amp;quot;ExampleImageSet&amp;quot;,&amp;quot;Base&amp;quot;,CEGUI::Point(0.0f,0.0f),CEGUI::Size(texture-&amp;gt;getWidth()-512,texture-&amp;gt;getHeight()-512),CEGUI::Point(0.0f,0.0f));&lt;br /&gt;
	&lt;br /&gt;
	//should not be necessary, if anything weird appears try redrawing the image&lt;br /&gt;
	//renderTarget-&amp;gt;requestRedraw();&lt;br /&gt;
}&lt;br /&gt;
//this function replaces the image in the given imageset with the new coordinates that are passed with this function&lt;br /&gt;
void GUIHud::createSubImage(CEGUI::String imageSetName,CEGUI::String imageName, CEGUI::Point start, CEGUI::Size size,CEGUI::Point offset)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Imageset* curr_imageset = CEGUI::ImagesetManager::getSingleton().getImageset(imageSetName);&lt;br /&gt;
	CEGUI::Texture* texture = curr_imageset-&amp;gt;getTexture();&lt;br /&gt;
	curr_imageset-&amp;gt;undefineImage(imageName);&lt;br /&gt;
	curr_imageset-&amp;gt;defineImage(imageName,start,size,offset);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this code was written with Ogre, but the main lines of it should be clear i think.&lt;/div&gt;</summary>
		<author><name>Hawkeyenl</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Creating_a_sub_image&amp;diff=2181</id>
		<title>Creating a sub image</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Creating_a_sub_image&amp;diff=2181"/>
				<updated>2006-05-28T18:03:48Z</updated>
		
		<summary type="html">&lt;p&gt;Hawkeyenl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Creating a subimage==&lt;br /&gt;
I found that it might be usefull to be able to create a subimage from an image. Say for instance u have a minimap created from a file, and you want to be able to zoom it. For this purpose it's best to use a subimage from the map. Basically this code can be used to complete that task:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//this function is just called to show the imageloading from a file, and selecting a subpart of the image&lt;br /&gt;
void GUIHud::createMMap()&lt;br /&gt;
{&lt;br /&gt;
	//load in a file, replace with your own file&lt;br /&gt;
	CEGUI::Texture* texture = mGUIRenderer-&amp;gt;createTexture(&amp;quot;Ground1.bmp&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	//create a new imageset with an image that spans the entire texture&lt;br /&gt;
	CEGUI::Imageset* set = CEGUI::ImagesetManager::getSingleton().createImageset((CEGUI::utf8*)&amp;quot;ExampleImageSet&amp;quot;,texture);&lt;br /&gt;
	set-&amp;gt;defineImage(&amp;quot;Base&amp;quot;,CEGUI::Point(0.0f,0.0f),CEGUI::Size(texture-&amp;gt;getWidth(),texture-&amp;gt;getHeight()),CEGUI::Point(0.0f,0.0f));&lt;br /&gt;
&lt;br /&gt;
	//create a new window for this stuff and link the created image to it&lt;br /&gt;
	CEGUI::StaticImage* renderTarget = (CEGUI::StaticImage*)CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)&amp;quot;SEM/StaticImage&amp;quot;, (CEGUI::utf8*)&amp;quot;BaseWindow&amp;quot;);&lt;br /&gt;
	renderTarget-&amp;gt;setSize(CEGUI::Size(0.3f, 0.4f));&lt;br /&gt;
	CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)topElement)-&amp;gt;addChildWindow(renderTarget);&lt;br /&gt;
    renderTarget-&amp;gt;setPosition(CEGUI::Point(0.6, 0.6));&lt;br /&gt;
	renderTarget-&amp;gt;setImage(&amp;amp;set-&amp;gt;getImage((CEGUI::utf8*)&amp;quot;Base&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	/*this function replaces the image with the new coordinates passed with it, which selects a subimage,&lt;br /&gt;
	  and replaces the given image with the newly created one */&lt;br /&gt;
	createSubImage(&amp;quot;ExampleImageSet&amp;quot;,&amp;quot;Base&amp;quot;,CEGUI::Point(0.0f,0.0f),CEGUI::Size(texture-&amp;gt;getWidth()-512,texture-&amp;gt;getHeight()-512),CEGUI::Point(0.0f,0.0f));&lt;br /&gt;
	&lt;br /&gt;
	//should not be necessary, if anything weird appears try redrawing the image&lt;br /&gt;
	//renderTarget-&amp;gt;requestRedraw();&lt;br /&gt;
}&lt;br /&gt;
//this function replaces the image in the given imageset with the new coordinates that are passed with this function&lt;br /&gt;
void GUIHud::createSubImage(CEGUI::String imageSetName,CEGUI::String imageName, CEGUI::Point start, CEGUI::Size size,CEGUI::Point offset)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Imageset* curr_imageset = CEGUI::ImagesetManager::getSingleton().getImageset(imageSetName);&lt;br /&gt;
	CEGUI::Texture* texture = curr_imageset-&amp;gt;getTexture();&lt;br /&gt;
	curr_imageset-&amp;gt;undefineImage(imageName);&lt;br /&gt;
	curr_imageset-&amp;gt;defineImage(imageName,start,size,offset);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this code was written with Ogre, but the main lines of it should be clear i think.&lt;/div&gt;</summary>
		<author><name>Hawkeyenl</name></author>	</entry>

	</feed>