<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: XNA Game Engine Tutorial Series #4 &#8211; DrawOrder</title>
	<atom:link href="http://www.innovativegames.net/blog/2008/10/18/engine-tutorial-4/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.innovativegames.net/blog/2008/10/18/engine-tutorial-4/</link>
	<description>Independent game development blog by Sean James</description>
	<lastBuildDate>Sun, 07 Mar 2010 09:14:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Alex</title>
		<link>http://www.innovativegames.net/blog/2008/10/18/engine-tutorial-4/comment-page-1/#comment-5402</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Wed, 16 Sep 2009 13:39:05 +0000</pubDate>
		<guid isPermaLink="false">http://innovativegames.net/blog/?p=138#comment-5402</guid>
		<description>Edit: The code for the while loop in my previous comment didn&#039;t come out right, so here it is again:

while (i &lt; inDrawOrder.Count)
{
    if (Items[inDrawOrder[i]].DrawOrder &gt; ord)
        break;
    else
        i++;
}</description>
		<content:encoded><![CDATA[<p>Edit: The code for the while loop in my previous comment didn&#8217;t come out right, so here it is again:</p>
<p>while (i &lt; inDrawOrder.Count)<br />
{<br />
    if (Items[inDrawOrder[i]].DrawOrder &gt; ord)<br />
        break;<br />
    else<br />
        i++;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.innovativegames.net/blog/2008/10/18/engine-tutorial-4/comment-page-1/#comment-5401</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Wed, 16 Sep 2009 13:33:39 +0000</pubDate>
		<guid isPermaLink="false">http://innovativegames.net/blog/?p=138#comment-5401</guid>
		<description>A word of warning: As stated above, the while loop in the UpdateDrawPosition method in the ComponentCollection class is wrong.  To get it to work properly change it to this:

while (i  ord)
        break;
    else
        i++;
}

This will enable the InDrawOrder list to work correctly. 

NOTE: If you are NOT explicitly setting the DrawOrder property of your components they are being assigned a default DrawOrder = 1, and thus they will be drawn in the order in which they are created (i.e. 1st created is 1st drawn), making the last component to be created appear at the &#039;front&#039; of the screen (drawn on top of the other components)

Also, if you are NOT explicitly setting the DrawOrder property, and thus ALL your components have a DrawOrder = 1, then you can move any component in the collection to the back of InDrawOrder by simply saying:

component.DrawOrder = 1;
e.g. actor.DrawOrder = 1;

This effectively brings that component to the front of the screen, since it&#039;s drawn last.</description>
		<content:encoded><![CDATA[<p>A word of warning: As stated above, the while loop in the UpdateDrawPosition method in the ComponentCollection class is wrong.  To get it to work properly change it to this:</p>
<p>while (i  ord)<br />
        break;<br />
    else<br />
        i++;<br />
}</p>
<p>This will enable the InDrawOrder list to work correctly. </p>
<p>NOTE: If you are NOT explicitly setting the DrawOrder property of your components they are being assigned a default DrawOrder = 1, and thus they will be drawn in the order in which they are created (i.e. 1st created is 1st drawn), making the last component to be created appear at the &#8216;front&#8217; of the screen (drawn on top of the other components)</p>
<p>Also, if you are NOT explicitly setting the DrawOrder property, and thus ALL your components have a DrawOrder = 1, then you can move any component in the collection to the back of InDrawOrder by simply saying:</p>
<p>component.DrawOrder = 1;<br />
e.g. actor.DrawOrder = 1;</p>
<p>This effectively brings that component to the front of the screen, since it&#8217;s drawn last.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricsh</title>
		<link>http://www.innovativegames.net/blog/2008/10/18/engine-tutorial-4/comment-page-1/#comment-5041</link>
		<dc:creator>Ricsh</dc:creator>
		<pubDate>Tue, 11 Aug 2009 18:46:18 +0000</pubDate>
		<guid isPermaLink="false">http://innovativegames.net/blog/?p=138#comment-5041</guid>
		<description>having trouble understanding what i is keeping track of exactly so many indexes flying around at the moment these lines are confusing me

if (Items[inDrawOrder[i]].DrawOrder &gt; ord)

What does 

Items
inDrawOrder
i

represent in terms of the game. i know there varibles/lists</description>
		<content:encoded><![CDATA[<p>having trouble understanding what i is keeping track of exactly so many indexes flying around at the moment these lines are confusing me</p>
<p>if (Items[inDrawOrder[i]].DrawOrder &gt; ord)</p>
<p>What does </p>
<p>Items<br />
inDrawOrder<br />
i</p>
<p>represent in terms of the game. i know there varibles/lists</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricsh</title>
		<link>http://www.innovativegames.net/blog/2008/10/18/engine-tutorial-4/comment-page-1/#comment-5039</link>
		<dc:creator>Ricsh</dc:creator>
		<pubDate>Tue, 11 Aug 2009 16:24:57 +0000</pubDate>
		<guid isPermaLink="false">http://innovativegames.net/blog/?p=138#comment-5039</guid>
		<description>Not sure if this site is still active, but was wondering if anyone could explain line s 40 onwards in a bit more detail, i understand what its doing, just seems to be a complicated way of doing it.</description>
		<content:encoded><![CDATA[<p>Not sure if this site is still active, but was wondering if anyone could explain line s 40 onwards in a bit more detail, i understand what its doing, just seems to be a complicated way of doing it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yanko</title>
		<link>http://www.innovativegames.net/blog/2008/10/18/engine-tutorial-4/comment-page-1/#comment-3485</link>
		<dc:creator>Yanko</dc:creator>
		<pubDate>Wed, 15 Apr 2009 21:39:40 +0000</pubDate>
		<guid isPermaLink="false">http://innovativegames.net/blog/?p=138#comment-3485</guid>
		<description>it does not display the box just red back ground? why?</description>
		<content:encoded><![CDATA[<p>it does not display the box just red back ground? why?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
