<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Maratis forum - Full GUI]]></title>
		<link>http://forum.maratis3d.com/viewtopic.php?id=910</link>
		<description><![CDATA[The most recent posts in Full GUI.]]></description>
		<lastBuildDate>Fri, 30 May 2014 12:21:03 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Full GUI]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6845#p6845</link>
			<description><![CDATA[<p>A great classic !</p><p>you will get that dll for sure if you install VS2010 (don&#039;t know about the others VS)<br />or maybe this will work : <a href="http://www.microsoft.com/en-us/download/details.aspx?id=5555">http://www.microsoft.com/en-us/download &#133; px?id=5555</a></p>]]></description>
			<author><![CDATA[dummy@example.com (Vegas)]]></author>
			<pubDate>Fri, 30 May 2014 12:21:03 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6845#p6845</guid>
		</item>
		<item>
			<title><![CDATA[Re: Full GUI]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6842#p6842</link>
			<description><![CDATA[<p>When I try to open the project, it says the program can&#039;t run because MSVCR100D.dll is missing from my computer. </p><p>It tells me to re-install the program to fix the problem.</p>]]></description>
			<author><![CDATA[dummy@example.com (Tutorial Doctor)]]></author>
			<pubDate>Fri, 30 May 2014 03:56:06 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6842#p6842</guid>
		</item>
		<item>
			<title><![CDATA[Re: Full GUI]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6841#p6841</link>
			<description><![CDATA[<p><a href="https://dl.dropboxusercontent.com/u/19970067/Maratis/Various/Display.rar">Here&#039;s a project</a> and it&#039;s dll, a blender file and a gimp file. containing all you need for an 1024x768 interface (but nothing else than THIS resolution)&nbsp; </p><p>The pane on the GUIScene will totally fit what the camera sees but.. dont go full screen nor increase window size &gt;.&lt;</p><p>If you want to make your own interface with anael&#039;s method,</p><p>Let&#039;s say this is your interface (grey area for the UI, transparent area for the game) :</p><p><span class="postimg"><img src="https://dl.dropboxusercontent.com/u/19970067/Maratis/Various/Int1.png" alt="PunBB bbcode test" /></span></p><p>First move your cursor at the extreme left and top of the transparent area (the red pixel)<br />these are X and Y position of your game window</p><p><span class="postimg"><img src="https://dl.dropboxusercontent.com/u/19970067/Maratis/Various/Int3.png" alt="PunBB bbcode test" /></span></p><p>Then select the whole transparent area and take note of the width/height</p><p><span class="postimg"><img src="https://dl.dropboxusercontent.com/u/19970067/Maratis/Various/Int2.png" alt="PunBB bbcode test" /></span></p><p>put all the values in the code ; </p><div class="codebox"><pre><code>    int X = 10; // pos x
    int Y = 10; // pos y
    int W = 500; // width
    int H = 300; // height

    render-&gt;setViewport(
           X,
           viewport[3]-H-Y,
           W,
           H
    );</code></pre></div><br /><p>compile, run game ; it&#039;s gg.</p><p>Hope it helps</p>]]></description>
			<author><![CDATA[dummy@example.com (Vegas)]]></author>
			<pubDate>Thu, 29 May 2014 21:44:32 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6841#p6841</guid>
		</item>
		<item>
			<title><![CDATA[Re: Full GUI]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6836#p6836</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>I want to make it easily editable for beginning Maratis users (no complicated setup).</p></blockquote></div><p>For a HUD with no interactions,<br />if you want to display some informations like in FPS games, using camera layering is enough,<br />if you want a full interface, go with Anael&#039;s method, even if you need VS, you can easily set up the window exactly where you want to</p><p>But for a clickable interface, when we will be able to use physic detection from one scene to another, <br />it will be very easy but for now it will be quite bulky (could work with a set up like in my first post figure 3)</p><div class="quotebox"><blockquote><p>The main issue is positioning things over the camera at a precise point.</p></blockquote></div><p>I have a blender file that may help you - i hope i didn&#039;t deleted/modified it - keep you in touch</p><p>for the WindowScale unfortunately i never made tests with that stuff</p>]]></description>
			<author><![CDATA[dummy@example.com (Vegas)]]></author>
			<pubDate>Thu, 29 May 2014 17:36:01 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6836#p6836</guid>
		</item>
		<item>
			<title><![CDATA[Re: Full GUI]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6833#p6833</link>
			<description><![CDATA[<p>Hi Vegas. Trying to see how to go about making an easy to use GUI system for the starter pack. </p><p>Right now I just have an orthographic camera in a separate scene, and am using enableCamerLayer to display it over a camera. The main issue is positioning things over the camera at a precise point.</p><p>I figured I would have to use getWindowScale also so that things are positioned relative to the window size.</p><p>What does renderToTexture do for your GUI?</p><p>I want to make it easily editable for beginning Maratis users (no complicated setup).</p>]]></description>
			<author><![CDATA[dummy@example.com (Tutorial Doctor)]]></author>
			<pubDate>Wed, 28 May 2014 18:08:05 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6833#p6833</guid>
		</item>
		<item>
			<title><![CDATA[Re: Full GUI]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6825#p6825</link>
			<description><![CDATA[<div class="quotebox"><cite>Tutorial Doctor wrote:</cite><blockquote><p>I am trying to do a GUI myself now, and I am running into all sorts of snags. <img src="http://forum.maratis3d.com/img/smilies/sad.png" width="15" height="15" alt="sad" /></p></blockquote></div><p>What&#039;s going on?</p>]]></description>
			<author><![CDATA[dummy@example.com (Vegas)]]></author>
			<pubDate>Mon, 26 May 2014 21:32:53 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6825#p6825</guid>
		</item>
		<item>
			<title><![CDATA[Re: Full GUI]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6798#p6798</link>
			<description><![CDATA[<p>I am trying to do a GUI myself now, and I am running into all sorts of snags. <img src="http://forum.maratis3d.com/img/smilies/sad.png" width="15" height="15" alt="sad" /></p>]]></description>
			<author><![CDATA[dummy@example.com (Tutorial Doctor)]]></author>
			<pubDate>Mon, 19 May 2014 23:38:41 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6798#p6798</guid>
		</item>
		<item>
			<title><![CDATA[Re: Full GUI]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6174#p6174</link>
			<description><![CDATA[<p>Outstanding <img src="http://forum.maratis3d.com/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /> works like a charm ! Many Thanks <img src="http://forum.maratis3d.com/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></description>
			<author><![CDATA[dummy@example.com (Vegas)]]></author>
			<pubDate>Sat, 11 Jan 2014 10:16:51 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6174#p6174</guid>
		</item>
		<item>
			<title><![CDATA[Re: Full GUI]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6173#p6173</link>
			<description><![CDATA[<p>Sure, you can do this if you still use percents (if the screen need to adapt to the resolution) :<br /></p><div class="codebox"><pre><code>    int marginLeft = viewport[2]*0.1f;
    int marginRight = viewport[2]*0.1f;
    int marginTop = viewport[3]*0.1f;
    int marginBottom = viewport[3]*0.1f;

    render-&gt;setViewport(
           viewport[0]+marginLeft,
           viewport[1]+marginBottom,
           viewport[2]-marginRight-marginLeft,
           viewport[3]-marginBottom-marginTop
    );</code></pre></div><p>or if you want to enter pixel coords direcly :<br /></p><div class="codebox"><pre><code>    int X = 10; // pos x
    int Y = 10; // pos y
    int W = 500; // width
    int H = 300; // height

    render-&gt;setViewport(
           X,
           viewport[3]-H-Y,
           W,
           H
    );</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Sat, 11 Jan 2014 03:58:41 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6173#p6173</guid>
		</item>
		<item>
			<title><![CDATA[Re: Full GUI]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6172#p6172</link>
			<description><![CDATA[<p>That&#039;s working great! thanks you!</p><p>But i noticed the game window is always centered,<br />to make it more usable, could it be possible to set-up<br />4 margins and make the game screen fit inside it ? (dont know if that&#039;s realistic)<br />or adjust the game window position with (X, Y, width, height) values ?</p><p>that would allow to make interfaces like <a href="http://img14.exs.cx/img14/886/insidedahq2ri.jpg">This one</a> or <a href="http://www.the-nextlevel.com/tnl/attachment.php%3Fattachmentid%3D56911%26d%3D1279785900">This one</a></p><p>Oh and it doesn&#039;t worked when using &quot;release&quot; mode (had alot of errors popping up), only debug mode worked</p><div class="quotebox"><blockquote><p>Et voila, a custom game plugin, you&#039;ll see it&#039;s no so complicated once you understand c/c++ syntax.<br />In c++ you can access the engine directly, so anything can be done.</p></blockquote></div><p>Yeah it makes want to investigate that stuff, but... i already know how it will end <img src="http://forum.maratis3d.com/img/smilies/tongue.png" width="15" height="15" alt="tongue" /> (bad)</p>]]></description>
			<author><![CDATA[dummy@example.com (Vegas)]]></author>
			<pubDate>Sat, 11 Jan 2014 01:45:52 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6172#p6172</guid>
		</item>
		<item>
			<title><![CDATA[Re: Full GUI]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6171#p6171</link>
			<description><![CDATA[<p>so the example run fine with the GUI and the rotating box and all ?</p><p>if yes, now you can replace the code of MGame.cpp by this :<br /></p><div class="codebox"><pre><code>/////////////////////////////////////////////////////////////////////////////////////////////////////////
// SimpleGamePlugin
// MyGame.cpp
// 
// Code : Anael Seghezzi
/////////////////////////////////////////////////////////////////////////////////////////////////////////

#include &quot;MyGame.h&quot;


// constructor
MyGame::MyGame(void):
MGame()
{}

// destructor
MyGame::~MyGame(void)
{}


// GUI scene and objects
MScene * GUIScene = NULL;


// custom begin scene
void MyGame::onBeginScene(void)
{
    MGame::onBeginScene(); // call the default MGame begin scene
    
    MEngine * engine = MEngine::getInstance(); // get the engine instance
    MLevel * level = engine-&gt;getLevel(); // get the current level
    
    // get GUI scene
    GUIScene = level-&gt;getSceneByName(&quot;GUIScene&quot;);
}

// custom update
void MyGame::update(void)
{
    // custom GUI
    if(GUIScene) // check if the scene exist
    {
        // update GUI scene
        GUIScene-&gt;update();
        GUIScene-&gt;updateObjectsMatrices();
    }
    
    MGame::update(); // call the default MGame update (update current scene physics, animations, script... as done by default)
}

// custom draw
void MyGame::draw(void)
{
    MEngine * engine = MEngine::getInstance(); // get the engine instance
    MRenderingContext * render = engine-&gt;getRenderingContext(); // get the rendering context
    
    // use a smaller viewport for the current scene
    int viewport[4];
    render-&gt;getViewport(viewport);
    
    int marginX = viewport[2]*0.1f; // create a 10% margin of the current screen width : change this for your game
    int marginY = viewport[3]*0.1f; // create a 10% margin of the current screen height : change this for your game
    render-&gt;setViewport(viewport[0]+marginX, viewport[1]+marginY, viewport[2]-marginX*2, viewport[3]-marginY*2);

    MGame::draw(); // call the default MGame draw (this will draw the current scene as done by default)
    
    // restore the viewport
    render-&gt;setViewport(viewport[0], viewport[1], viewport[2], viewport[3]);
    
    
    // custom GUI
    if(GUIScene) // check if the scene exist
    {
        if(GUIScene-&gt;getCamerasNumber() &gt; 0) // check if there is a camera in the GUI scene
        {
            MOCamera * camera = GUIScene-&gt;getCameraByIndex(0); // get the first camera
            
            render-&gt;clear(M_BUFFER_DEPTH); // clear depth buffer (to not be affeted by the current scene)
            
            // draw GUI on top
            camera-&gt;enable();
            GUIScene-&gt;draw(camera);
        }
    }
}</code></pre></div><p>- Then use your own game instead of the example or copy the dll in your game directory.<br />- name your GUI scene &quot;GUIScene&quot; or change the reference name in Game.cpp<br />- don&#039;t use render to texture or scene layer for the gui (it&#039;s all done by the cpp)</p><p>The code create a smaller viewport to render the current scene and draw the scene named &quot;GUIScene&quot; on top.</p><p>The part dealing with the viewport size is this :<br /></p><div class="quotebox"><blockquote><p>int marginX = viewport[2]*0.1f; // create a 10% margin of the current screen width : change this for your game<br />int marginY = viewport[3]*0.1f; // create a 10% margin of the current screen height : change this for your game</p></blockquote></div><p>Et voila, a custom game plugin, you&#039;ll see it&#039;s no so complicated once you understand c/c++ syntax.<br />In c++ you can access the engine directly, so anything can be done.</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Fri, 10 Jan 2014 17:32:46 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6171#p6171</guid>
		</item>
		<item>
			<title><![CDATA[Re: Full GUI]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6170#p6170</link>
			<description><![CDATA[<p>Ok i get it... it was one of the most obvious item in the top bar *facepalm* <br />Well thank you, everything&#039;s fine now <img src="http://forum.maratis3d.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (Vegas)]]></author>
			<pubDate>Fri, 10 Jan 2014 07:35:59 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6170#p6170</guid>
		</item>
		<item>
			<title><![CDATA[Re: Full GUI]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6168#p6168</link>
			<description><![CDATA[<p>&quot;release&quot; should be somewhere in the top bar,<br />usually a project is in &quot;debug&quot; mode by default, if you see &quot;debug&quot; somewhere, clic on it to change to release.</p><p>when you compile, the project should create a file named &quot;Game.dll&quot;<br />if it&#039;s not done by visual studio, copy it inside the maratis project folder</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Fri, 10 Jan 2014 06:17:05 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6168#p6168</guid>
		</item>
		<item>
			<title><![CDATA[Re: Full GUI]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6158#p6158</link>
			<description><![CDATA[<p>Alright, i used 2010 express edition (i remember having trouble with 2005 version, that was always missing window.h)</p><p>So, opening the .sln file makes the program crash, but it&#039;s ok with the vcproj (it just ask for converting it)</p><p>Weirdly, setting paths in the Game header (in the tree view), was not enough, <br />i had to manually enter paths for every .cpp files, after that, it worked <img src="http://forum.maratis3d.com/img/smilies/wink.png" width="15" height="15" alt="wink" /></p><p>(ps. I didn&#039;t find the &quot;release&quot; mode option, where is this ? (in french if possible <img src="http://forum.maratis3d.com/img/smilies/tongue.png" width="15" height="15" alt="tongue" />))</p>]]></description>
			<author><![CDATA[dummy@example.com (Vegas)]]></author>
			<pubDate>Thu, 09 Jan 2014 15:24:10 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6158#p6158</guid>
		</item>
		<item>
			<title><![CDATA[Re: Full GUI]]></title>
			<link>http://forum.maratis3d.com/viewtopic.php?pid=6156#p6156</link>
			<description><![CDATA[<p>tell me if something is not going well,<br />it should be ok, there is a visual studio project in the example</p><p>- install visual studio (version 2005 works, express edition is free, I&#039;m not sure with the more recent versions)<br />- open the .sln file<br />- check the paths in the project properties<br />OR be sure the .sln file access maratis SDK folder this way : &quot;..\..\..\..\SDK&quot;<br />OR open the vcproj file with a text editor and replace &quot;..\..\..\..\SDK&quot; by your own path<br />- compile in &quot;release&quot; mode</p>]]></description>
			<author><![CDATA[dummy@example.com (anael)]]></author>
			<pubDate>Thu, 09 Jan 2014 13:57:34 +0000</pubDate>
			<guid>http://forum.maratis3d.com/viewtopic.php?pid=6156#p6156</guid>
		</item>
	</channel>
</rss>
