<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-30411126</id><updated>2018-03-05T08:51:29.778-08:00</updated><category term="General"/><category term="Xna"/><category term="Development"/><category term="News"/><category term="GameDev"/><category term="DrawableGameComponent"/><category term="Game"/><category term="Programming"/><category term="GameComponent"/><category term="Community"/><category term="C#"/><category term="Tools"/><category term="Utilities"/><category term="DreamBuildPlay"/><category term="HLSL"/><category term="Resources"/><category term="Shader"/><category term="XBLA"/><title type='text'>TehOne.com Gaming And Development Blog</title><subtitle type='html'>TehOne&#39;s gaming related topics and game development/programming resources with XNA and C# for begginers and other general topics.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.tehone.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default'/><link rel='alternate' type='text/html' href='http://blog.tehone.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>TehOne</name><uri>http://www.blogger.com/profile/04537679822648159970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-30411126.post-1767794182837102535</id><published>2007-04-03T11:40:00.001-07:00</published><updated>2007-04-03T11:49:56.905-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="General"/><category scheme="http://www.blogger.com/atom/ns#" term="News"/><title type='text'>I am movEd in!!!</title><content type='html'>&lt;p&gt;Just wanted to post a quick update and inform everyone that I have finally finished moving into my new place. I&#39;m still waiting for my new desk (end of week)&amp;nbsp;and also for my DSL (should be on today when i get home unless SBC messed up again). Once I get those 2 things, I should be able to make some progress on a few things I have been working on/thinking about. I have been doing a little work on my Sprite; SpriteSheet; SpriteManager classes and so far it&#39;s turning out pretty good. I can&#39;t wait to be set in my new office in my new house so that I can get back to work and get the classes finished up and polished off and get them out the community for review.&lt;/p&gt;
&lt;br/&gt;
&lt;p&gt;After that, I plan to make a SpriteLayer class. Basically it will just be a parent Sprite with nested (child)&amp;nbsp;Sprites. And when the parent is moved; scaled; rotated, the children will move. This will be useful for the next thing i intend on writing, which will be an animation utility for animating sprites. This will be useful for creating some effects. One of the big reasons for me in making this, will be to add transitions and effects (maybe for menu screens etc...).&lt;/p&gt;
&lt;br/&gt;
&lt;p&gt;Anyways, I just wante to give a quick update on where things are at with me right now. As I said in my last update post, this blog is not dead, it has just been hard to get things done while moving out of 2 different apartments into 1 new house. Well, hopefully I will have more posts next week and hopefully they will have the classes mentioned above that I have been working on!&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.tehone.com/feeds/1767794182837102535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30411126&amp;postID=1767794182837102535' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/1767794182837102535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/1767794182837102535'/><link rel='alternate' type='text/html' href='http://blog.tehone.com/2007/04/i-am-moved-in.html' title='I am movEd in!!!'/><author><name>TehOne</name><uri>http://www.blogger.com/profile/04537679822648159970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30411126.post-5453304058094192296</id><published>2007-03-20T12:59:00.000-07:00</published><updated>2007-03-20T13:08:11.331-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="General"/><category scheme="http://www.blogger.com/atom/ns#" term="News"/><category scheme="http://www.blogger.com/atom/ns#" term="XBLA"/><category scheme="http://www.blogger.com/atom/ns#" term="Xna"/><title type='text'>Xbox Live Arcade Approval Process</title><content type='html'>Via: &lt;a href=&quot;http://www.gamedevblog.com/2007/03/some_answers.html&quot;&gt;http://www.gamedevblog.com/2007/03/some_answers.html&lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;
It&#39;s an interesting little read. Get a little insight on what it may take to get your XNA game onto &lt;accr title=&quot;Xbox Live Arcade&quot;&gt;XBLA&lt;/accr&gt;
&lt;br/&gt;&lt;br/&gt;
&lt;blockquote&gt;To get an Xbox Live Arcade game approved, there&#39;s various stages and greenlight meetings you have to get through.  First you&#39;ve got to get somebody there excited enough to get it into a greenlight meeting in the first place.&lt;/blockquote&gt;
&lt;br/&gt;
&lt;blockquote&gt;The next stage is the &quot;Concept Greenlight&quot;&lt;/blockquote&gt;
&lt;br/&gt;
&lt;blockquote&gt;The next stage is a due diligence meeting&lt;/blockquote&gt;
&lt;br/&gt;
&lt;blockquote&gt;Coming up later is the certification or TRC - the &quot;technical requirements checklist&quot;&lt;/blockquote&gt;
&lt;br/&gt;&lt;br/&gt;
&lt;span class=&quot;fullpost&quot;&gt;&lt;a name=&quot;ReadMore&quot;&gt;&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.tehone.com/feeds/5453304058094192296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30411126&amp;postID=5453304058094192296' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/5453304058094192296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/5453304058094192296'/><link rel='alternate' type='text/html' href='http://blog.tehone.com/2007/03/xbox-live-arcade-approval-process.html' title='Xbox Live Arcade Approval Process'/><author><name>TehOne</name><uri>http://www.blogger.com/profile/04537679822648159970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30411126.post-8316816066780423060</id><published>2007-03-19T11:47:00.000-07:00</published><updated>2007-03-19T11:52:26.998-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="General"/><category scheme="http://www.blogger.com/atom/ns#" term="News"/><title type='text'>Changed Rss/Atom Feed</title><content type='html'>I have changed my feed over from the built in Blogger rss/atom feeds, to use FeedBurner instead. If you have subscribed to my blog, you may want to update your feed with the new address: &lt;a href=&quot;http://feeds.feedburner.com/TehOne&quot;&gt;http://feeds.feedburner.com/TehOne&lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;
Please let me know if you have any problems with the new feed.
&lt;br/&gt;&lt;br/&gt;
Thanks.
&lt;span class=&quot;fullpost&quot;&gt;&lt;a name=&quot;ReadMore&quot;&gt;&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.tehone.com/feeds/8316816066780423060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30411126&amp;postID=8316816066780423060' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/8316816066780423060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/8316816066780423060'/><link rel='alternate' type='text/html' href='http://blog.tehone.com/2007/03/changed-rssatom-feed.html' title='Changed Rss/Atom Feed'/><author><name>TehOne</name><uri>http://www.blogger.com/profile/04537679822648159970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30411126.post-3945450949199975996</id><published>2007-03-19T10:29:00.000-07:00</published><updated>2007-03-19T10:40:44.123-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Development"/><category scheme="http://www.blogger.com/atom/ns#" term="DrawableGameComponent"/><category scheme="http://www.blogger.com/atom/ns#" term="GameDev"/><category scheme="http://www.blogger.com/atom/ns#" term="General"/><category scheme="http://www.blogger.com/atom/ns#" term="News"/><category scheme="http://www.blogger.com/atom/ns#" term="Xna"/><title type='text'>Activity</title><content type='html'>I haven&#39;t had much time to work on my XNA stuff lately or make a any new posts. I&#39;m in the middle of moving out of 2 homes and into a new one. So, this has monopolized a lot of my free time. Hopefully I&#39;ll be able to get to work a little more once I get into the new place after the first week April. Things I have been working on are a Texture2DManager, a Sprite DrawableGameComponent and a SpriteLayer DrawableGameComponent. After these are done, I plan to work on some Transition effects stuff.
&lt;br/&gt;&lt;br/&gt;
Well, just wanted to put this news out there (not that anyone is paying attention anyways). This blog isn&#39;t dead already or anything like that.
&lt;br/&gt;&lt;br/&gt;
&lt;span class=&quot;fullpost&quot;&gt;&lt;a name=&quot;ReadMore&quot;&gt;&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.tehone.com/feeds/3945450949199975996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30411126&amp;postID=3945450949199975996' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/3945450949199975996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/3945450949199975996'/><link rel='alternate' type='text/html' href='http://blog.tehone.com/2007/03/activity.html' title='Activity'/><author><name>TehOne</name><uri>http://www.blogger.com/profile/04537679822648159970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30411126.post-7521445911917623879</id><published>2007-03-13T14:15:00.000-07:00</published><updated>2007-03-13T14:42:15.479-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Development"/><category scheme="http://www.blogger.com/atom/ns#" term="Game"/><category scheme="http://www.blogger.com/atom/ns#" term="GameDev"/><category scheme="http://www.blogger.com/atom/ns#" term="HLSL"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Resources"/><category scheme="http://www.blogger.com/atom/ns#" term="Shader"/><title type='text'>Looking for Shaders?</title><content type='html'>If your looking for &lt;a href=&quot;http://en.wikipedia.org/wiki/HLSL&quot;&gt;HLSL&lt;/a&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Shaders&quot;&gt;Shaders&lt;/a&gt; here is a great place to try to find one that fits your needs. NVidia has released a large library of &quot;ready to go&quot; HLSL shaders that you can download and use in your project. This &lt;a href=&quot;http://developer.download.nvidia.com/licenses/general_license.txt&quot;&gt;license&lt;/a&gt; applies.
&lt;br/&gt;&lt;br/&gt;
&lt;a href=&quot;http://developer.download.nvidia.com/shaderlibrary/webpages/shader_library.html&quot;&gt;http://developer.download.nvidia.com/shaderlibrary/webpages/shader_library.html&lt;/a&gt;
&lt;br/&gt;&lt;br/&gt;
I personally don&#39;t have any experience with shaders. I have always thought they were only for 3D games. But now I have seen some 2D games where they are used for effects and also things like adding a bit of &quot;depth&quot; to the 2D game with water etc... An example can be seen here (by &lt;a href=&quot;http://blog.skasoftware.com/index.php&quot;&gt;Ska Software&lt;/a&gt;):
&lt;br/&gt;
&lt;object width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/DkCj1YD8tUc&quot;&gt;&lt;/param&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/DkCj1YD8tUc&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot; width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;/embed&gt;&lt;/object&gt;
&lt;br/&gt;
&lt;span class=&quot;fullpost&quot;&gt;&lt;a name=&quot;ReadMore&quot;&gt;&lt;/a&gt;Since seeing that shaders can be used in 2D games with great results, I will be spending more time exploring them. I was probably going to try to use sprites/textures for adding some &quot;pop&quot; to any games I developed. But now that I have seen shaders in 2D games, I think I&#39;ll explore using them instead. Only time will tell. In any case, this is a great resource.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.tehone.com/feeds/7521445911917623879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30411126&amp;postID=7521445911917623879' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/7521445911917623879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/7521445911917623879'/><link rel='alternate' type='text/html' href='http://blog.tehone.com/2007/03/looking-for-shaders.html' title='Looking for Shaders?'/><author><name>TehOne</name><uri>http://www.blogger.com/profile/04537679822648159970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30411126.post-8576619325919766852</id><published>2007-03-08T22:35:00.000-08:00</published><updated>2007-03-08T22:38:34.354-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Development"/><category scheme="http://www.blogger.com/atom/ns#" term="DrawableGameComponent"/><category scheme="http://www.blogger.com/atom/ns#" term="Game"/><category scheme="http://www.blogger.com/atom/ns#" term="GameComponent"/><category scheme="http://www.blogger.com/atom/ns#" term="GameDev"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Tools"/><category scheme="http://www.blogger.com/atom/ns#" term="Utilities"/><category scheme="http://www.blogger.com/atom/ns#" term="Xna"/><title type='text'>Mouse2D GameComponent</title><content type='html'>Here is my &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_08/docs/&quot; target=&quot;_webDocs&quot;&gt;Mouse2D&lt;/a&gt; &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.drawablegamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;DrawableGameComponent&lt;/a&gt;. I started out just wanting to be able to put a custom &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.input.mouse.aspx&quot; target=&quot;_msdn&quot;&gt;Mouse&lt;/a&gt; pointer/cursor on the screen instead of the windows mouse. From there the code just seemed to keep evolving more and more. After I got my custom pointer on the screen, I wanted to then place a &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.graphics.texture2d.aspx&quot; target=&quot;_msdn&quot;&gt;Texture2D&lt;/a&gt; where it clicked (this was mostly for debugging etc, but I think turned out to be useful for other things). I could see this feature being used in map editors maybe, or something where you want to give the user the ability to design what they see on the screen.
&lt;br/&gt;&lt;br/&gt;
Well, from there I just kept adding more and more to the code. Instead of just placing a &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.graphics.texture2d.aspx&quot; target=&quot;_msdn&quot;&gt;Texture2D&lt;/a&gt; where a click occurred, I wanted to create an event system for the clicks. So, I started adding this in. Then, instead of just tracking clicks, I decided to track when the button is released as well. I also added events for the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.input.mouse.aspx&quot; target=&quot;_msdn&quot;&gt;Mouse&lt;/a&gt; scroll wheel as well. Then I created events for when the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.input.mouse.aspx&quot; target=&quot;_msdn&quot;&gt;Mouse&lt;/a&gt; was moved. After all that I decided that I should pass back some useful information from the events. So, when the &lt;a href=&quot;http://tehone.com/xna/blogger/2007%5F03%5F08/docs/html/96c4efed-f83a-53fc-d157-c251954bc5f4.htm&quot; target=&quot;_webDocs&quot;&gt;MouseMoved&lt;/a&gt; event is fired, we pass back &lt;a href=&quot;http://tehone.com/xna/blogger/2007%5F03%5F08/docs/html/6144f3cb-ef54-acf7-80c1-9df49b794163.htm&quot; target=&quot;_webDocs&quot;&gt;MouseMovedEventArgs&lt;/a&gt; which contains the &lt;a href=&quot;http://tehone.com/xna/blogger/2007%5F03%5F08/docs/html/9c968ea3-492d-1193-13fa-7089fcbe9870.htm&quot; target=&quot;_webDocs&quot;&gt;Movement&lt;/a&gt; property which is a &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.vector2.aspx&quot; target=&quot;_msdn&quot;&gt;Vector2&lt;/a&gt; that represents how much the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.input.mouse.aspx&quot; target=&quot;_msdn&quot;&gt;Mouse&lt;/a&gt; has moved in the X and Y direction since the last update.
&lt;br/&gt;&lt;br/&gt;
&lt;span class=&quot;fullpost&quot;&gt;&lt;a name=&quot;ReadMore&quot;&gt;&lt;/a&gt;As well as adding some useful information into the events for &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.input.mouse.aspx&quot; target=&quot;_msdn&quot;&gt;Mouse&lt;/a&gt; movement, I also wanted to add some information on the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.input.mouse.aspx&quot; target=&quot;_msdn&quot;&gt;Mouse&lt;/a&gt; button clicks and releases. So the &lt;a href=&quot;http://tehone.com/xna/blogger/2007%5F03%5F08/docs/html/f4005450-feed-602a-2ba5-eee6417f2ce2.htm&quot; target=&quot;_webDocs&quot;&gt;ClickEventArgs&lt;/a&gt; class was then created. This contains the &lt;a href=&quot;http://tehone.com/xna/blogger/2007%5F03%5F08/docs/html/20e0d857-0a66-2bf7-cd69-ed554f85ac41.htm&quot; target=&quot;_webDocs&quot;&gt;Click&lt;/a&gt; and &lt;a href=&quot;http://tehone.com/xna/blogger/2007%5F03%5F08/docs/html/6f3f9017-172e-a3b6-1630-db675e01cba7.htm&quot; target=&quot;_webDocs&quot;&gt;PreviousClick&lt;/a&gt; properties. By using these, you can figure out how a click occured, and how much the user moved the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.input.mouse.aspx&quot; target=&quot;_msdn&quot;&gt;Mouse&lt;/a&gt; before they release the button. This could be useful for drag and drop type of actions (maybe for selecting units in an rts style game) etc. It can also be used to find out how much time in between the click and the release of the button. There are &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/system.eventhandler.aspx&quot; target=&quot;_msdn&quot;&gt;event handlers&lt;/a&gt; for each &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.input.mouse.aspx&quot; target=&quot;_msdn&quot;&gt;Mouse&lt;/a&gt; button and it&#39;s state, and for the scroll wheel changes and for the mouses movement.
&lt;br/&gt;&lt;br/&gt;
I called this &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.drawablegamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;DrawableGameComponent&lt;/a&gt; Mouse2D because it was developed with 2D games in mind (since I have zero 3D game developing skills). I&#39;m not familiar with 3D enough yet to know if this class would need to be changed in order to be affective for 3D game projects. Well, I think that gives enough of an introduction to this. Now I&#39;ll post some code. Since the code for &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_08/docs/&quot; target=&quot;_webDocs&quot;&gt;Mouse2D&lt;/a&gt; is a bit long, especially with the xml comments etc), I won&#39;t be putting code from it in this blog post. You will have to download the code in order to view it. Instead, I&#39;m going to post some sample code of how you might use it in a game.
&lt;br/&gt;&lt;br/&gt;
Ok, now on to the code. (&lt;a href=&quot;http://tehone.com/xna/XnaOpenCopyright.txt&quot;&gt;code license&lt;/a&gt;)
&lt;div class=&quot;DownloadCodeLinkWrapper&quot;&gt;
You can download the full source code here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_08/TehOne.Xna.GameComponents.zip&quot;&gt;TehOne.Xna.GameComponents.zip&lt;/a&gt;
&lt;br/&gt;
The Mouse2D game demo is here &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_08/Mouse2DDemo.zip&quot;&gt;Mouse2DDemo.zip&lt;/a&gt;
&lt;br/&gt;
The online documentation is here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_08/docs/&quot; target=&quot;_webDocs&quot;&gt;Documentation&lt;/a&gt;
&lt;br/&gt;
The offline documentation is here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_08/docs/Documentation.chm&quot;&gt;Documentation.chm&lt;/a&gt; (recommended)
&lt;/div&gt;
&lt;br/&gt;
Ok, to start, you would just create a new Widows Game using &lt;a href=&quot;http://msdn.microsoft.com/xna/&quot; target=&quot;_msdn&quot;&gt;XNA&lt;/a&gt; &lt;abbr title=&quot;Game Studio Express&quot;&gt;GSE&lt;/abbr&gt;. You should now have a project with a Game1.cs file in it. This is the base for starting your &lt;a href=&quot;http://msdn.microsoft.com/xna/&quot; target=&quot;_msdn&quot;&gt;XNA&lt;/a&gt; game. You should end up with something like the below for the first few lines of your new Game1.cs file:
&lt;br/&gt;
&lt;!-- code formatted by http://tehone.com/utils/SourceFormat/ --&gt;
&lt;div class=&quot;tosf tosf450&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;div class=&quot;toolbar-showplain&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;plaintext&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;plaintext&#39;);&quot; /&gt;Show Plain Text&lt;/div&gt;
&lt;div class=&quot;toolbar-showlinenums&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;linenumbers&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;linenumbers&#39;);&quot; /&gt;Show Line #&lt;/div&gt;
&lt;div class=&quot;toolbar-showaltlines&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;altlines&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;altlines&#39;);&quot; /&gt;Alternating Lines&lt;/div&gt;
&lt;div class=&quot;toolbar-hiderem&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;hiderem&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;hiderem&#39;);&quot; /&gt;Hide Comments&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;tosfInner&quot;&gt;
&lt;ol class=&quot;formatted tabSpacing2 OutsideDecimal&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; Using Statements&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.Xna.Framework;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.Xna.Framework.Audio;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.Xna.Framework.Content;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.Xna.Framework.Graphics;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.Xna.Framework.Input;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.Xna.Framework.Storage;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; WindowsGame1&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;{&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// This is the main type for your game&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Game1 : Microsoft.Xna.Framework.Game&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;GraphicsDeviceManager graphics;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ContentManager content;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; Game1()&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;graphics = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; GraphicsDeviceManager(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;content = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ContentManager(Services);&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br/&gt;
Ok, so, we&#39;ll change the above to this:
&lt;!-- code formatted by http://tehone.com/utils/SourceFormat/ --&gt;
&lt;div class=&quot;tosf tosf450&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;div class=&quot;toolbar-showplain&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;plaintext&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;plaintext&#39;);&quot; /&gt;Show Plain Text&lt;/div&gt;
&lt;div class=&quot;toolbar-showlinenums&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;linenumbers&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;linenumbers&#39;);&quot; /&gt;Show Line #&lt;/div&gt;
&lt;div class=&quot;toolbar-showaltlines&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;altlines&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;altlines&#39;);&quot; /&gt;Alternating Lines&lt;/div&gt;
&lt;div class=&quot;toolbar-hiderem&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;hiderem&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;hiderem&#39;);&quot; /&gt;Hide Comments&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;tosfInner&quot;&gt;
&lt;ol class=&quot;formatted tabSpacing2 OutsideDecimal&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; Using Statements&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.Xna.Framework;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.Xna.Framework.Audio;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.Xna.Framework.Content;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.Xna.Framework.Graphics;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.Xna.Framework.Input;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.Xna.Framework.Storage;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; TehOne.Xna.GameComponents;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; WindowsGame1&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;{&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// This is the main type for your game&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Game1 : Microsoft.Xna.Framework.Game&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;GraphicsDeviceManager graphics;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ContentManager content;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MousePointer2D mousePointer;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; Game1()&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;graphics = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; GraphicsDeviceManager(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;);&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;content = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ContentManager(Services);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mousePointer = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; MousePointer2D(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Components.Add(mousePointer);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br/&gt;
Basically, what we did was, we added a field to the class to hold our &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_08/docs/&quot; target=&quot;_webDocs&quot;&gt;Mouse2D&lt;/a&gt; object. Then, in the constructor, we instantiated the &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_08/docs/&quot; target=&quot;_webDocs&quot;&gt;Mouse2D&lt;/a&gt; object and stored it in our newly created field. Then, we add the object to the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.components.aspx&quot; target=&quot;_msdn&quot;&gt;Game.Components&lt;/a&gt; collection. If you were to build the game now, you should see a mouse cursor/pointer on the screen. The &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.graphics.texture2d.aspx&quot; target=&quot;_msdn&quot;&gt;Texture2D&lt;/a&gt; being used for the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.input.mouse.aspx&quot; target=&quot;_msdn&quot;&gt;Mouse&lt;/a&gt; is an embedded resource in the TehOne.Xna.GameComponents dll. If you want to use your own &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.graphics.texture2d.aspx&quot; target=&quot;_msdn&quot;&gt;Texture2D&lt;/a&gt;, then you would set the &lt;a href=&quot;http://tehone.com/xna/blogger/2007%5F03%5F08/docs/html/2c163728-cb18-d937-c73a-8249c7717eed.htm&quot; target=&quot;_webDocs&quot;&gt;PointerAssetName&lt;/a&gt; in the constructor, like below:
&lt;!-- code formatted by http://tehone.com/utils/SourceFormat/ --&gt;
&lt;div class=&quot;tosf tosf450&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;div class=&quot;toolbar-showplain&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;plaintext&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;plaintext&#39;);&quot; /&gt;Show Plain Text&lt;/div&gt;
&lt;div class=&quot;toolbar-showlinenums&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;linenumbers&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;linenumbers&#39;);&quot; /&gt;Show Line #&lt;/div&gt;
&lt;div class=&quot;toolbar-showaltlines&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;altlines&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;altlines&#39;);&quot; /&gt;Alternating Lines&lt;/div&gt;
&lt;div class=&quot;toolbar-hiderem&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;hiderem&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;hiderem&#39;);&quot; /&gt;Hide Comments&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;tosfInner&quot;&gt;
&lt;ol class=&quot;formatted tabSpacing2 OutsideDecimal&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; Game1()&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;{&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;graphics = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; GraphicsDeviceManager(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;);&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;content = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ContentManager(Services);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;mousePointer = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; MousePointer2D(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Components.Add(mousePointer);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;mousePointer.PointerAssetName = &lt;span class=&quot;str&quot;&gt;@&quot;Content\Sprites\YourMouseAsset&quot;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br/&gt;
As long as the &lt;a href=&quot;http://tehone.com/xna/blogger/2007%5F03%5F08/docs/html/2c163728-cb18-d937-c73a-8249c7717eed.htm&quot; target=&quot;_webDocs&quot;&gt;PointerAssetName&lt;/a&gt; that you set exists, then you will now see your custom pointer on the screen if you rebuild the project. If the &lt;a href=&quot;http://tehone.com/xna/blogger/2007%5F03%5F08/docs/html/2c163728-cb18-d937-c73a-8249c7717eed.htm&quot; target=&quot;_webDocs&quot;&gt;PointerAssetName&lt;/a&gt; that you set doesn&#39;t exist, the &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_08/docs/&quot; target=&quot;_webDocs&quot;&gt;Mouse2D&lt;/a&gt; will still use it&#39;s internal &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.graphics.texture2d.aspx&quot; target=&quot;_msdn&quot;&gt;Texture2D&lt;/a&gt; for the mouse. That is unless you set &lt;a href=&quot;http://tehone.com/xna/blogger/2007%5F03%5F08/docs/html/19b874da-c260-cd99-69e0-587529a39650.htm&quot; target=&quot;_webDocs&quot;&gt;CanUseInteralAssets&lt;/a&gt; property to false. If you did set that to false, and your &lt;a href=&quot;http://tehone.com/xna/blogger/2007%5F03%5F08/docs/html/2c163728-cb18-d937-c73a-8249c7717eed.htm&quot; target=&quot;_webDocs&quot;&gt;PointerAssetName&lt;/a&gt; you set doesn&#39;t exist, then you will get an exception thrown.
&lt;br/&gt;&lt;br/&gt;
Now, to show how to hook into the events. This is a very simple example (to keep this post shorter). A more complete example is included in the code download. This shows you how to move a sprite when the mouse moves. I currently only having it moving from left to right for the sake of example (boundry detection is not being done either). What we are doing is adding a method to be fired when the mouse moves. Then we wire this event into the &lt;a href=&quot;http://tehone.com/xna/blogger/2007%5F03%5F08/docs/html/96c4efed-f83a-53fc-d157-c251954bc5f4.htm&quot; target=&quot;_webDocs&quot;&gt;MouseMoved&lt;/a&gt; event of the &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_08/docs/&quot; target=&quot;_webDocs&quot;&gt;Mouse2D&lt;/a&gt; object.
&lt;!-- code formatted by http://tehone.com/utils/SourceFormat/ --&gt;
&lt;div class=&quot;tosf tosf450&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;div class=&quot;toolbar-showplain&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;plaintext&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;plaintext&#39;);&quot; /&gt;Show Plain Text&lt;/div&gt;
&lt;div class=&quot;toolbar-showlinenums&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;linenumbers&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;linenumbers&#39;);&quot; /&gt;Show Line #&lt;/div&gt;
&lt;div class=&quot;toolbar-showaltlines&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;altlines&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;altlines&#39;);&quot; /&gt;Alternating Lines&lt;/div&gt;
&lt;div class=&quot;toolbar-hiderem&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;hiderem&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;hiderem&#39;);&quot; /&gt;Hide Comments&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;tosfInner tosfInner500&quot;&gt;
&lt;ol class=&quot;formatted tabSpacing2 OutsideDecimal&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Game1 : Microsoft.Xna.Framework.Game&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;{&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;GraphicsDeviceManager graphics;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;ContentManager content;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;MousePointer2D mousePointer;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; SpriteBatch _spriteBatch;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; Texture2D _sprite;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; Vector2 _spritePosition = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Vector2(0, 0);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; Game1()&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;graphics = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; GraphicsDeviceManager(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;content = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ContentManager(Services);&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mousePointer = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; MousePointer2D(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;);&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Components.Add(mousePointer);&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mousePointer.PointerAssetName = &lt;span class=&quot;str&quot;&gt;@&quot;Content\Sprites\YourMouseAsset&quot;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mousePointer.MouseMoved += &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; MousePointer2D.MouseMovedHandler(mousePointer_MouseMoved);&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; mousePointer_MouseMoved(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, MousePointer2D.MouseMovedEventArgs e)&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_spritePosition.X = mousePointer.Position.X;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; LoadGraphicsContent(&lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; loadAllContent)&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt;(loadAllContent)&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_spriteBatch = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SpriteBatch(graphics.GraphicsDevice);&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_sprite = content.Load&amp;lt;Texture2D&amp;gt;(@&lt;span class=&quot;str&quot;&gt;&quot;Content\Sprites\YourSpriteName&quot;&lt;/span&gt;);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Draw(GameTime gameTime)&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;device.Clear(Color.CornflowerBlue);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_spriteBatch.Begin();&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_spriteBatch.Draw(_sprite, _spritePosition, Color.White);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_spriteBatch.End();&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.Draw(gameTime);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br/&gt;
For the last example, I&#39;ll wire up some events for the scroll wheel and a left click. First we need to create our methods for each, and then wire them up to the proper events. For the &lt;a href=&quot;http://tehone.com/xna/blogger/2007%5F03%5F08/docs/html/6acf0257-16d7-daa2-022e-bc4021d1654e.htm&quot; target=&quot;_webDocs&quot;&gt;ScrollChanged&lt;/a&gt; event, we create a mousePointer_ScrollChanged method and when it is fired, we check to see which way the scroll wheel was moved (up or down). And then we set our sprites Y position based on it. For the &lt;a href=&quot;http://tehone.com/xna/blogger/2007%5F03%5F08/docs/html/bb3de119-da22-fe26-08e6-0e892ae64e3a.htm&quot; target=&quot;_webDocs&quot;&gt;LeftButtonPressed event&lt;/a&gt;, we create the mousePointer_LeftButtonClicked method and when it is fired we move the our sprites postion to the postion where the click occured.
&lt;!-- code formatted by http://tehone.com/utils/SourceFormat/ --&gt;
&lt;div class=&quot;tosf tosf450&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;div class=&quot;toolbar-showplain&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;plaintext&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;plaintext&#39;);&quot; /&gt;Show Plain Text&lt;/div&gt;
&lt;div class=&quot;toolbar-showlinenums&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;linenumbers&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;linenumbers&#39;);&quot; /&gt;Show Line #&lt;/div&gt;
&lt;div class=&quot;toolbar-showaltlines&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;altlines&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;altlines&#39;);&quot; /&gt;Alternating Lines&lt;/div&gt;
&lt;div class=&quot;toolbar-hiderem&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;hiderem&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;hiderem&#39;);&quot; /&gt;Hide Comments&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;tosfInner&quot;&gt;
&lt;ol class=&quot;formatted tabSpacing2 OutsideDecimal&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; Game1()&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;{&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;graphics = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; GraphicsDeviceManager(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;);&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;content = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ContentManager(Services);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;mousePointer = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; MousePointer2D(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Components.Add(mousePointer);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;mousePointer.PointerAssetName = &lt;span class=&quot;str&quot;&gt;@&quot;Content\Sprites\YourMouseAsset&quot;&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;mousePointer.MouseMoved += &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; MousePointer2D.MouseMovedHandler(mousePointer_MouseMoved);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;mousePointer.ScrollChanged +=&lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; MousePointer2D.ScrollChangedHandler(mousePointer_ScrollChanged);&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;mousePointer.LeftButtonPressed += &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; MousePointer2D.ClickHandler(mousePointer_LeftButtonClicked);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; mousePointer_MouseMoved(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, MousePointer2D.MouseMovedEventArgs e)&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;{&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;_spritePosition.X = mousePointer.Position.X;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; mousePointer_ScrollChanged(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, MousePointer2D.ScrollChangedEventArgs e)&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;{&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (e.Direction == MousePointer2D.ScrollChangedEventArgs.ScrollDirection.Up)&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_spritePosition.Y -= _sprite.Height;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (e.Direction == MousePointer2D.ScrollChangedEventArgs.ScrollDirection.Down)&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_spritePosition.Y += _sprite.Height;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;}&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; mousePointer_LeftButtonClicked(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, MousePointer2D.ClickEventArgs e)&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;{&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;_spritePosition = e.Click.Position;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;}&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br/&gt;
&lt;div class=&quot;DownloadCodeLinkWrapper&quot;&gt;
You can download the full source code here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_08/TehOne.Xna.GameComponents.zip&quot;&gt;TehOne.Xna.GameComponents.zip&lt;/a&gt;
&lt;br/&gt;
The Mouse2D game demo is here &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_08/Mouse2DDemo.zip&quot;&gt;Mouse2DDemo.zip&lt;/a&gt;
&lt;br/&gt;
The online documentation is here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_08/docs/&quot; target=&quot;_webDocs&quot;&gt;Documentation&lt;/a&gt;
&lt;br/&gt;
The offline documentation is here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_08/docs/Documentation.chm&quot;&gt;Documentation.chm&lt;/a&gt; (recommended)
&lt;/div&gt;
&lt;br/&gt;
As always, I would really appreciate some feeback on this. I&#39;m sure people can make use of this code (especially beginers). And I&#39;m even more sure that it can be improved with input from others (especially those with more experience then me).
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.tehone.com/feeds/8576619325919766852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30411126&amp;postID=8576619325919766852' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/8576619325919766852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/8576619325919766852'/><link rel='alternate' type='text/html' href='http://blog.tehone.com/2007/03/mouse2d-gamecomponent.html' title='Mouse2D GameComponent'/><author><name>TehOne</name><uri>http://www.blogger.com/profile/04537679822648159970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30411126.post-744767535639621904</id><published>2007-03-06T23:40:00.000-08:00</published><updated>2007-03-07T00:10:12.905-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Community"/><category scheme="http://www.blogger.com/atom/ns#" term="Development"/><category scheme="http://www.blogger.com/atom/ns#" term="General"/><category scheme="http://www.blogger.com/atom/ns#" term="News"/><category scheme="http://www.blogger.com/atom/ns#" term="Tools"/><category scheme="http://www.blogger.com/atom/ns#" term="Utilities"/><title type='text'>New Source Code Formatting</title><content type='html'>Well, after some talking back and forth with &lt;a href=&quot;http://www.ziggyware.com/&quot;&gt;ziggy&lt;/a&gt; about the code formatting I was using, I have decided to change it. Luckily for me, the &lt;a href=&quot;http://www.manoli.net/csharpformat/&quot;&gt;page&lt;/a&gt; I was using to do the formatting, also has the source code available. I have taken the code and modified it with a look and features that I wanted. You can check out how the code looks by checking out my articles where I posted code, and you can view the tool here... &lt;a href=&quot;http://tehone.com/utils/SourceFormat/&quot;&gt;http://tehone.com/utils/SourceFormat/&lt;/a&gt;

I&#39;m open to opinions on the code format and I&#39;ll be posting the modified source soon.</content><link rel='replies' type='application/atom+xml' href='http://blog.tehone.com/feeds/744767535639621904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30411126&amp;postID=744767535639621904' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/744767535639621904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/744767535639621904'/><link rel='alternate' type='text/html' href='http://blog.tehone.com/2007/03/new-source-code-formatting.html' title='New Source Code Formatting'/><author><name>TehOne</name><uri>http://www.blogger.com/profile/04537679822648159970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30411126.post-383997589889630202</id><published>2007-03-05T01:51:00.000-08:00</published><updated>2007-03-05T01:56:12.318-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Community"/><category scheme="http://www.blogger.com/atom/ns#" term="DreamBuildPlay"/><category scheme="http://www.blogger.com/atom/ns#" term="General"/><category scheme="http://www.blogger.com/atom/ns#" term="News"/><category scheme="http://www.blogger.com/atom/ns#" term="Xna"/><title type='text'>Dream-Build-Play’s main competition has gone live.</title><content type='html'>As well as the new creators website being launched, the kind folks over at the official xna team blog also released the information below. I must say, those are some pretty fantastic prizes. Unfortunately for me, I don&#39;t think my skills are up to entering the contest. But, I&#39;ll have a lot of fun watching/reading (and hopefully seeing the source code eventually) what others are up to. I guess &lt;a href=&quot;http://amapplease.blogspot.com/2007/03/xna-games-article-on-official-xbox.html&quot;&gt;Ultrahead&lt;/a&gt; didn&#39;t have to stay tuned very long. Too bad he went to sleep i bet, and let me snap up this information first.
&lt;br/&gt;
&lt;blockquote&gt;Dream-Build-Play’s main competition has gone live.

Fame, fortune and a chance at global envy await you in our Dream-Build-Play competition. The grand prize is a $10,000, an awesome Alienware PC with a smokin’ fast AMD FX processor and ATI graphics card, 3D modeling software, Xbox 360, XNA Creators Club subscription tokens and an amazingly cool Xbox Live Arcade publishing contract for your chance to get your game published on Xbox Live Arcade. Do you have what it takes to win all that and more? Then get started on making your dream game using XNA Game Studio Express and head on over to http://www.dreambuildplay.com to enter it into the contest. &lt;/blockquote&gt;</content><link rel="related" href="http://blogs.msdn.com/xna/archive/2007/03/04/it-s-time-once-more-for-the-game-developer-conference-gdc-and-we-ve-got-a-lot-of-exciting-news-to-share.aspx" title="Dream-Build-Play’s main competition has gone live."/><link rel='replies' type='application/atom+xml' href='http://blog.tehone.com/feeds/383997589889630202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30411126&amp;postID=383997589889630202' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/383997589889630202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/383997589889630202'/><link rel='alternate' type='text/html' href='http://blog.tehone.com/2007/03/dream-build-plays-main-competition-has.html' title='Dream-Build-Play’s main competition has gone live.'/><author><name>TehOne</name><uri>http://www.blogger.com/profile/04537679822648159970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30411126.post-6838032866111006819</id><published>2007-03-05T01:29:00.000-08:00</published><updated>2007-03-05T01:39:17.773-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Community"/><category scheme="http://www.blogger.com/atom/ns#" term="General"/><category scheme="http://www.blogger.com/atom/ns#" term="News"/><category scheme="http://www.blogger.com/atom/ns#" term="Xna"/><title type='text'>XNA Creators site launched</title><content type='html'>A new site for XNA &quot;Creators&quot; has been put up by our friends at Microsoft. I took a brief look at the site and I think it&#39;s great. I think it has some bugs (wouldn&#39;t let me log in, something about not having a gamer tag even though i do have one). But, overall, the site looks great and it already has a few nice things on it. The first, a new starter kit. I think this is fantastic, we can never have too many examples check out. Another of interest to me, is a sample for font rendering in XNA. I have been hoping we would get this without having to wait too long and it looks like its coming. Not sure when, but they look like they could release it the way it is, or at least in the near future. There are other resources on the site too and hopefully they will be very active with the site and keep posting updates/code/tutorials/starter kits etc. I think the biggest winner here will be the community.
&lt;br/&gt;&lt;br/&gt;
From the article:
&lt;br/&gt;&lt;br/&gt;
&lt;blockquote&gt;The XNA Creators Club Online community site is open for business!

Head on over to http://creators.xna.com and register for the XNA Creators Club Online community. You’ll find some great content such as:

    * A brand new starter kit! (Marblets)
    * Several samples including a skinning (animation) sample using the XNA Framework Content Pipeline!
    * Downloadable sample games.
      New developer forums.
    * Video tutorials.
    * Much, much, more!&lt;/blockquote&gt;</content><link rel="related" href="http://blogs.msdn.com/xna/archive/2007/03/04/it-s-time-once-more-for-the-game-developer-conference-gdc-and-we-ve-got-a-lot-of-exciting-news-to-share.aspx" title="XNA Creators site launched"/><link rel='replies' type='application/atom+xml' href='http://blog.tehone.com/feeds/6838032866111006819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30411126&amp;postID=6838032866111006819' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/6838032866111006819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/6838032866111006819'/><link rel='alternate' type='text/html' href='http://blog.tehone.com/2007/03/xna-creators-site-launched.html' title='XNA Creators site launched'/><author><name>TehOne</name><uri>http://www.blogger.com/profile/04537679822648159970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30411126.post-3725718067464653916</id><published>2007-03-03T03:11:00.001-08:00</published><updated>2007-03-07T00:09:30.463-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Development"/><category scheme="http://www.blogger.com/atom/ns#" term="DrawableGameComponent"/><category scheme="http://www.blogger.com/atom/ns#" term="Game"/><category scheme="http://www.blogger.com/atom/ns#" term="GameComponent"/><category scheme="http://www.blogger.com/atom/ns#" term="GameDev"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Xna"/><title type='text'>Framerate GameComponent</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;Updated Again:&lt;/span&gt; Reformatted source again. Should be the last time. Check out &lt;a href=&quot;http://blog.tehone.com/2007/03/new-source-code-formatting.html&quot;&gt;this post for details&lt;/a&gt;.
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Updated:&lt;/span&gt; Removed line numbers in code snippets after some constructive criticism from &lt;a href=&quot;http://www.ziggyware.com/&quot;&gt;ziggy&lt;/a&gt;.
&lt;br /&gt;
&lt;br /&gt;
Here is my implementation of a &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_03/docs/html/cd0a9e34-15e3-d64d-6732-4d9c13d88ec9.htm&quot; target=&quot;_webDocs&quot;&gt;Framerate&lt;/a&gt; (&lt;abbr title=&quot;Frames Per Second&quot;&gt;FPS&lt;/abbr&gt;) &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;GameComponent&lt;/a&gt;. It is a &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.drawablegamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;DrawableGameComponent&lt;/a&gt; even though in it&#39;s current form it doesn&#39;t actually draw anything to the screen. Since there is currently no built in font/text rendering in &lt;a href=&quot;http://msdn.microsoft.com/xna/&quot; target=&quot;_msdn&quot;&gt;XNA&lt;/a&gt;, this component currently only updates the game window title with the current &lt;abbr title=&quot;Frames Per Second&quot;&gt;FPS&lt;/abbr&gt;. It can be easily adapted to draw the framerate to the screen by using something like &lt;a href=&quot;http://www.nuclex.org/framework/fonts&quot;&gt;Nuclex.Fonts&lt;/a&gt; or &lt;a href=&quot;http://blogs.msdn.com/garykac/archive/2006/08/30/728521.aspx&quot;&gt;BitmapFonts&lt;/a&gt;. But to keep implementation as simple as possible, this is left out of this component for now. This component exposes a &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_03/docs/html/d4eb4830-8d89-5961-71b8-f5720feb1574.htm&quot; target=&quot;_webDocs&quot;&gt;CurrentFramerate&lt;/a&gt; property that you can use in your &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.aspx&quot; target=&quot;_msdn&quot;&gt;Game&lt;/a&gt; code to easily draw the &lt;abbr title=&quot;Frames Per Second&quot;&gt;FPS&lt;/abbr&gt; to the screen without having to recompile the TehOne.Xna.GameComponents code.
&lt;br/&gt;&lt;br/&gt;
&lt;span class=&quot;fullpost&quot;&gt;&lt;a name=&quot;ReadMore&quot;&gt;&lt;/a&gt;This &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_03/docs/html/cd0a9e34-15e3-d64d-6732-4d9c13d88ec9.htm&quot; target=&quot;_webDocs&quot;&gt;Framerate&lt;/a&gt; component isn&#39;t that dissimilar to other framerate &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;GameComponents&lt;/a&gt; that you may have seen out there. The main difference is that it has a base class of &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_03/docs/html/7d99da99-dd53-be8e-db99-4675e5f457f8.htm&quot; target=&quot;_webDocs&quot;&gt;TehOne.Xna.GameComponents.XnaDrawableGameComponent&lt;/a&gt; instead of the regular &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.drawablegamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;DrawableGameComponent&lt;/a&gt; provided by Microsoft. To see the reason behind this, read up on my previous post &lt;a href=&quot;/2007/03/enabling-disabling-gamecomponents-when.html&quot;&gt;here&lt;/a&gt;. There are two other main differences from this and other framerate components that you may have seen on the web.
&lt;ul style=&quot;list-style-type: none&quot;;&gt;
 &lt;li&gt;The first difference:&lt;/li&gt;
 &lt;li style=&quot;margin-left: 2em;&quot;&gt;This class exposes a &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_03/docs/html/d4eb4830-8d89-5961-71b8-f5720feb1574.htm&quot; target=&quot;_webDocs&quot;&gt;CurrentFramerate&lt;/a&gt; property that you can then use in your game. I did this for two reasons: To allow you to have easy access to the current &lt;abbr title=&quot;Frames Per Second&quot;&gt;FPS&lt;/abbr&gt; from your game, so you can render text without having to integrate it into this component (and having to recompile it). And, the other reason is that now you can write code in your game that uses the &lt;abbr title=&quot;Frames Per Second&quot;&gt;FPS&lt;/abbr&gt; for some sort of logic. I was thinking that this would be useful for something like smoothing out animation based on the current &lt;abbr title=&quot;Frames Per Second&quot;&gt;FPS&lt;/abbr&gt;, or smoothing out movement or something else along those lines.&lt;/li&gt;
 &lt;li&gt;The second difference:&lt;/li&gt;
 &lt;li style=&quot;margin-left: 2em;&quot;&gt;This class has an &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_03/docs/html/5af86fdb-3a2b-bfb4-9f00-202f92df53f2.htm&quot; target=&quot;_webDocs&quot;&gt;UpdateFrequency&lt;/a&gt; property. This property allows you to set how often you want to calculate the &lt;abbr title=&quot;Frames Per Second&quot;&gt;FPS&lt;/abbr&gt;. I don&#39;t know about you, but most of the games I play update the &lt;abbr title=&quot;Frames Per Second&quot;&gt;FPS&lt;/abbr&gt; more then once a second. So, I thought that I would implement this feature. You can set the frequency to anything higher then 99 as long as it is divisible by 100. This property is based on milliseconds, so if you want to update your &lt;abbr title=&quot;Frames Per Second&quot;&gt;FPS&lt;/abbr&gt; every 10th of a second, then you would set this property to 100. Likewise, if you want to update your &lt;abbr title=&quot;Frames Per Second&quot;&gt;FPS&lt;/abbr&gt; every other second, you would set this property to 2000.&lt;/li&gt;
&lt;/ul&gt;
&lt;br/&gt;
Ok, now on to the code. (&lt;a href=&quot;http://tehone.com/xna/XnaOpenCopyright.txt&quot;&gt;code license&lt;/a&gt;)&lt;div class=&quot;DownloadCodeLinkWrapper&quot;&gt;
You can download the full source code here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_03/TehOne.Xna.GameComponents.zip&quot;&gt;TehOne.Xna.GameComponents.zip&lt;/a&gt;
&lt;br/&gt;
The online documentation is here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_03/docs/&quot; target=&quot;_webDocs&quot;&gt;Documentation&lt;/a&gt;
&lt;br/&gt;
The offline documentation is here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_03/docs/Documentation.chm&quot;&gt;Documentation.chm&lt;/a&gt; (recommended)
&lt;/div&gt;
&lt;br/&gt;&lt;br/&gt;
&lt;!-- code formatted by http://tehone.com/utils/SourceFormat/ --&gt;
&lt;div class=&quot;tosf tosf450&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;div class=&quot;toolbar-showplain&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;plaintext&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;plaintext&#39;);&quot; /&gt;Show Plain Text&lt;/div&gt;
&lt;div class=&quot;toolbar-showlinenums&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;linenumbers&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;linenumbers&#39;);&quot; /&gt;Show Line #&lt;/div&gt;
&lt;div class=&quot;toolbar-showaltlines&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;altlines&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;altlines&#39;);&quot; /&gt;Alternating Lines&lt;/div&gt;
&lt;div class=&quot;toolbar-hiderem&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;hiderem&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;hiderem&#39;);&quot; /&gt;Hide Comments&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;tosfInner tosfInner500&quot;&gt;
&lt;ol class=&quot;formatted tabSpacing2 OutsideDecimal&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Text;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.Xna.Framework;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; TehOne.Xna.GameComponents&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;{&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// This is a &amp;lt;see cref=&quot;XnaDrawableGameComponent&quot;/&amp;gt; that is used to calculate and display the current framerate (FPS, FramesPerSecond) of the game.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;para&amp;gt;Extends &amp;lt;see cref=&quot;XnaDrawableGameComponent&quot;/&amp;gt; so that we can use it&#39;s &amp;lt;see cref=&quot;XnaDrawableGameComponent.PreviouslyEnabled&quot;/&amp;gt; property and take advantage of it auto-enabling and disabling when the game is focused/not-focused.&amp;lt;/para&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Framerate : XnaDrawableGameComponent&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt; _fps = 0;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;float&lt;/span&gt; _elapsedRealTime = 0;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; _gameWindowTitle;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;ushort&lt;/span&gt; _updateFrequency = 1000;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;float&lt;/span&gt; _updateFrequencyRatio;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// The CurrentFramerate property represents the current frames per second (FPS) for the game.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;value&amp;gt;The CurrentFramerate property gets the &amp;lt;see cref=&quot;_fps&quot;/&amp;gt; data member.&amp;lt;/value&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt; CurrentFramerate&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; _fps;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// The UpdateFrequency property represents, in milliseconds, how often we are updating the &amp;lt;see cref=&quot;_fps&quot;/&amp;gt; count.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;value&amp;gt;The UpdateFrequency property gets/sets the &amp;lt;see cref=&quot;_updateFrequency&quot;/&amp;gt; data member.&amp;lt;/value&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;remarks&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// This is used to set how often we are calculating the frames per second count.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;para&amp;gt;The default value is &amp;lt;b&amp;gt;&amp;lt;c&amp;gt;1000&amp;lt;/c&amp;gt;&amp;lt;/b&amp;gt;.&amp;lt;/para&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;exception cref=&quot;System.ArgumentOutOfRangeException&quot;&amp;gt;This exception will be thrown when the &amp;lt;b&amp;gt;&amp;lt;c&amp;gt;value&amp;lt;/c&amp;gt;&amp;lt;/b&amp;gt; is set less then &amp;lt;b&amp;gt;&amp;lt;c&amp;gt;100&amp;lt;/c&amp;gt;&amp;lt;/b&amp;gt; or when &amp;lt;b&amp;gt;&amp;lt;c&amp;gt;value&amp;lt;/c&amp;gt;&amp;lt;/b&amp;gt; is not divisible by &amp;lt;b&amp;gt;&amp;lt;c&amp;gt;100&amp;lt;/c&amp;gt;&amp;lt;/b&amp;gt;.&amp;lt;/exception&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;ushort&lt;/span&gt; UpdateFrequency&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; _updateFrequency;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt;(&lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt; % 100 != 0 || &lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt; &amp;lt; 100)&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ArgumentOutOfRangeException(&lt;span class=&quot;str&quot;&gt;&quot;UpdateFrequency&quot;&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;The UpdateFrequency for the Framerate must is based on milliseconds and must be must be a positive number that is greater then or equal to 100, and the number must be divisable by 100.&quot;&lt;/span&gt;);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_updateFrequency = &lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;// Figure out the new ratio, this way we are reporting the correct frames per second even when we are not calculating ever second.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_updateFrequencyRatio = 1000 / (&lt;span class=&quot;kwrd&quot;&gt;float&lt;/span&gt;)_updateFrequency;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// The main constructor for the class.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;game&quot;&amp;gt;The &amp;lt;see cref=&quot;Microsoft.Xna.Framework.Game&quot; /&amp;gt; instance for this &amp;lt;see cref=&quot;XnaDrawableGameComponent&quot;/&amp;gt; to use.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;remarks&amp;gt;Sets the &amp;lt;see cref=&quot;_gameWindowTitle&quot;/&amp;gt; data member to the value of &amp;lt;see cref=&quot;Microsoft.Xna.Framework.GameWindow.Title&quot;/&amp;gt;.&amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; Framerate(Game game) : &lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;(game)&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;// Save the original game window title&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_gameWindowTitle = game.Window.Title;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;// We are basing the ratio on 1 second (1000 milliseconds)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_updateFrequencyRatio = 1000 / (&lt;span class=&quot;kwrd&quot;&gt;float&lt;/span&gt;)_updateFrequency;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// Allows the game component to perform any initialization it needs to before starting&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// to run.&amp;nbsp;&amp;nbsp;This is where it can query for any required services and load content.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Initialize()&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.Initialize();&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// Allows the game component to update itself.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;gameTime&quot;&amp;gt;Provides a snapshot of timing values.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Update(GameTime gameTime)&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.Update(gameTime);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (!&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Enabled)&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;// The total real time in milliseconds since the last Update().&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;float&lt;/span&gt; elapsed = (&lt;span class=&quot;kwrd&quot;&gt;float&lt;/span&gt;)gameTime.ElapsedRealTime.TotalMilliseconds;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;// Adds the Update() elapsed real time to the cumulative elapsed real time.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_elapsedRealTime += elapsed;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;// If the elapsed time is greater than our update frequency then: calculate the framerate, and reduce the elapsed real time count.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt;(_elapsedRealTime &amp;gt; _updateFrequency)&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_fps = (_updateFrequency / elapsed) * _updateFrequencyRatio; &lt;span class=&quot;rem&quot;&gt;// calculate the framerate&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_elapsedRealTime -= _updateFrequency; &lt;span class=&quot;rem&quot;&gt;// adjust the elapsedRealTime&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// This is called when the game should draw itself.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;gameTime&quot;&amp;gt;Provides a snapshot of timing values.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Draw(GameTime gameTime)&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.Draw(gameTime);&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (!&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Visible || !&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Enabled)&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Game.Window.Title = _gameWindowTitle + &lt;span class=&quot;str&quot;&gt;&quot; FPS: &quot;&lt;/span&gt; + _fps.ToString(&lt;span class=&quot;str&quot;&gt;&quot;F&quot;&lt;/span&gt;);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// This method is the &amp;lt;see cref=&quot;System.EventHandler&quot;/&amp;gt; for the &amp;lt;see cref=&quot;Microsoft.Xna.Framework.GameComponent.EnabledChanged&quot;/&amp;gt; event.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;sender&quot;&amp;gt;The events sender&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;args&quot;&amp;gt;The events arguments.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; OnEnabledChanged(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs args)&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt;(!&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Enabled)&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Game.Window.Title = _gameWindowTitle;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.OnEnabledChanged(sender, args);&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// This method is the &amp;lt;see cref=&quot;System.EventHandler&quot;/&amp;gt; for the &amp;lt;see cref=&quot;Microsoft.Xna.Framework.GameComponent.EnabledChanged&quot;/&amp;gt; event.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;sender&quot;&amp;gt;The events sender&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;args&quot;&amp;gt;The events arguments.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; OnVisibleChanged(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs args)&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (!&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Visible)&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Game.Window.Title = _gameWindowTitle;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.OnVisibleChanged(sender, args);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br/&gt;&lt;br/&gt;
Ok, so now we need to put this into our game. Add a member to your class for the &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_03/docs/html/cd0a9e34-15e3-d64d-6732-4d9c13d88ec9.htm&quot; target=&quot;_webDocs&quot;&gt;Framerate&lt;/a&gt;. It should look something like this:
&lt;!-- code formatted by http://tehone.com/utils/SourceFormat/ --&gt;
&lt;div class=&quot;tosf tosf450&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;div class=&quot;toolbar-showplain&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;plaintext&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;plaintext&#39;);&quot; /&gt;Show Plain Text&lt;/div&gt;
&lt;div class=&quot;toolbar-showlinenums&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;linenumbers&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;linenumbers&#39;);&quot; /&gt;Show Line #&lt;/div&gt;
&lt;div class=&quot;toolbar-showaltlines&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;altlines&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;altlines&#39;);&quot; /&gt;Alternating Lines&lt;/div&gt;
&lt;div class=&quot;toolbar-hiderem&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;hiderem&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;hiderem&#39;);&quot; /&gt;Hide Comments&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;tosfInner&quot;&gt;
&lt;ol class=&quot;formatted tabSpacing2 OutsideDecimal&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Game1 : Microsoft.Xna.Framework.Game&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ContentManager content;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;GraphicsDeviceManager graphics;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Framerate framerate;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br/&gt;&lt;br/&gt;
Now we need to instantiate the &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_03/docs/html/cd0a9e34-15e3-d64d-6732-4d9c13d88ec9.htm&quot; target=&quot;_webDocs&quot;&gt;Framerate&lt;/a&gt; and add it to the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.components.aspx&quot; target=&quot;_msdn&quot;&gt;Game.Components&lt;/a&gt; collection. This is done in your constructor for your game. It should look something like this:
&lt;!-- code formatted by http://tehone.com/utils/SourceFormat/ --&gt;
&lt;div class=&quot;tosf tosf450&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;div class=&quot;toolbar-showplain&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;plaintext&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;plaintext&#39;);&quot; /&gt;Show Plain Text&lt;/div&gt;
&lt;div class=&quot;toolbar-showlinenums&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;linenumbers&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;linenumbers&#39;);&quot; /&gt;Show Line #&lt;/div&gt;
&lt;div class=&quot;toolbar-showaltlines&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;altlines&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;altlines&#39;);&quot; /&gt;Alternating Lines&lt;/div&gt;
&lt;div class=&quot;toolbar-hiderem&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;hiderem&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;hiderem&#39;);&quot; /&gt;Hide Comments&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;tosfInner&quot;&gt;
&lt;ol class=&quot;formatted tabSpacing2 OutsideDecimal&quot;&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; Game1()&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;graphics = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; GraphicsDeviceManager(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;);&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;content = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ContentManager(Services);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;framerate = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Framerate(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;);&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;framerate.UpdateFrequency = 100;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Components.Add(framerate);&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br/&gt;&lt;br/&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Note:&lt;/span&gt; We also set the &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_03/docs/html/5af86fdb-3a2b-bfb4-9f00-202f92df53f2.htm&quot; target=&quot;_webDocs&quot;&gt;UpdateFrequency&lt;/a&gt; to 100 which will cause our &lt;abbr title=&quot;Frames Per Second&quot;&gt;FPS&lt;/abbr&gt; to be calculated every 10th of a second instead of the default of every once per second.
&lt;br/&gt;&lt;br/&gt;
Well, that is pretty much all there is to it. If you have done everything correctly, when you launch your (windowed) game, you should see the framerate in the window title.
&lt;br/&gt;&lt;br/&gt;
&lt;div class=&quot;DownloadCodeLinkWrapper&quot;&gt;
You can download the full source code here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_03/TehOne.Xna.GameComponents.zip&quot;&gt;TehOne.Xna.GameComponents.zip&lt;/a&gt;
&lt;br/&gt;
The online documentation is here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_03/docs/&quot; target=&quot;_webDocs&quot;&gt;Documentation&lt;/a&gt;
&lt;br/&gt;
The offline documentation is here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_03/docs/Documentation.chm&quot;&gt;Documentation.chm&lt;/a&gt; (recommended)
&lt;/div&gt;
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.tehone.com/feeds/3725718067464653916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30411126&amp;postID=3725718067464653916' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/3725718067464653916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/3725718067464653916'/><link rel='alternate' type='text/html' href='http://blog.tehone.com/2007/03/framerate-gamecomponent.html' title='Framerate GameComponent'/><author><name>TehOne</name><uri>http://www.blogger.com/profile/04537679822648159970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30411126.post-886560441147342256</id><published>2007-03-01T08:00:00.000-08:00</published><updated>2007-03-07T00:08:33.717-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Development"/><category scheme="http://www.blogger.com/atom/ns#" term="DrawableGameComponent"/><category scheme="http://www.blogger.com/atom/ns#" term="Game"/><category scheme="http://www.blogger.com/atom/ns#" term="GameComponent"/><category scheme="http://www.blogger.com/atom/ns#" term="GameDev"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Xna"/><title type='text'>Enabling-Disabling GameComponents when a game is Activated-Deactivated</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;Updated Again:&lt;/span&gt; Reformatted source again. Should be the last time. Check out &lt;a href=&quot;http://blog.tehone.com/2007/03/new-source-code-formatting.html&quot;&gt;this post for details&lt;/a&gt;.
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Updated:&lt;/span&gt; Removed line numbers in code snippets after some constructive criticism from &lt;a href=&quot;http://www.ziggyware.com/&quot;&gt;ziggy&lt;/a&gt;.
&lt;br /&gt;
&lt;br /&gt;
For my &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/bb203873.aspx#ID2EXF&quot; target=&quot;_msdn&quot;&gt;GameComponents&lt;/a&gt;, I wanted a graceful way to &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.enabled.aspx&quot; target=&quot;_msdn&quot;&gt;Disabled&lt;/a&gt; and then Re-&lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.enabled.aspx&quot; target=&quot;_msdn&quot;&gt;Enable&lt;/a&gt; them when the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.aspx&quot; target=&quot;_msdn&quot;&gt;Game&lt;/a&gt; is &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.onactivated.aspx&quot; target=&quot;_msdn&quot;&gt;Activated&lt;/a&gt; and when it is &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.ondeactivated.aspx&quot; target=&quot;_msdn&quot;&gt;Deactivated&lt;/a&gt;. The important thing for me was to &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.enabled.aspx&quot; target=&quot;_msdn&quot;&gt;Disable&lt;/a&gt; all of the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;GameComponents&lt;/a&gt; when the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.aspx&quot; target=&quot;_msdn&quot;&gt;Game&lt;/a&gt; gets &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.deactivated.aspx&quot; target=&quot;_msdn&quot;&gt;Deactivated&lt;/a&gt; and then when the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.aspx&quot; target=&quot;_msdn&quot;&gt;Game&lt;/a&gt; is &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.activated.aspx&quot; target=&quot;_msdn&quot;&gt;Activated&lt;/a&gt;, I want to Re-&lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.enabled.aspx&quot; target=&quot;_msdn&quot;&gt;Enable&lt;/a&gt; the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;GameComponents&lt;/a&gt; that were already &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.enabled.aspx&quot; target=&quot;_msdn&quot;&gt;Enabled&lt;/a&gt; prior to the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.aspx&quot; target=&quot;_msdn&quot;&gt;Game&lt;/a&gt; being &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.deactivated.aspx&quot; target=&quot;_msdn&quot;&gt;Deactivated&lt;/a&gt;.
&lt;br /&gt;
&lt;br /&gt;
The best way I saw to do this, was to extend the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;GameComponent&lt;/a&gt; class. So, that&#39;s what I have done for all (not that there is a lot yet, only 2 so far) of my custom &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;GameComponents&lt;/a&gt;.
&lt;br /&gt;
&lt;br /&gt;
So, here you&#39;ll find the code that I used to accomplish this. Maybe in a future version of &lt;a href=&quot;http://msdn.microsoft.com/xna/&quot; target=&quot;_msdn&quot;&gt;XNA&lt;/a&gt; this will be included into the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;GameComponent&lt;/a&gt; class.
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;fullpost&quot;&gt;&lt;a name=&quot;ReadMore&quot;&gt;&lt;/a&gt;All of the code on this site is subject to this license:
 &lt;!-- code formatted by http://tehone.com/utils/SourceFormat/ --&gt;
 &lt;div class=&quot;tosf tosf450&quot;&gt;
  &lt;div class=&quot;tosfInner&quot;&gt;
  &lt;ol class=&quot;formatted nolinecnt tabSpacing2 OutsideDecimal&quot;&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt;/*&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * Copyright (c) 2007, Eric Lebetsamer (http://tehone.com)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * Permission is hereby granted, free of charge, to any person obtaining a copy&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * of this software and associated documentation files (the &quot;Software&quot;), to deal&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * in the Software without restriction, including without limitation the rights to&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * the Software, and to permit persons to whom the Software is furnished to do so,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * subject to the following conditions:&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * The above copyright notice and this permission notice shall be included in all copies&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * or substantial portions of the Software.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; * USE OR OTHER DEALINGS IN THE SOFTWARE.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&lt;span class=&quot;rem&quot;&gt; */&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;/ol&gt;
  &lt;/div&gt;
 &lt;/div&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 Ok, now on to the code. (&lt;a href=&quot;http://tehone.com/xna/XnaOpenCopyright.txt&quot;&gt;code license&lt;/a&gt;)&lt;div class=&quot;DownloadCodeLinkWrapper&quot;&gt;
  You can download the full source code here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_01/TehOne.Xna.GameComponents.zip&quot;&gt;TehOne.Xna.GameComponents.zip&lt;/a&gt;
  &lt;br /&gt;
  The online documentation is here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_01/docs/&quot; target=&quot;_webDocs&quot;&gt;Documentation&lt;/a&gt;
  &lt;br /&gt;
  The offline documentation is here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_01/docs/Documentation.chm&quot;&gt;Documentation.chm&lt;/a&gt; (recommended)
 &lt;/div&gt;
 &lt;br /&gt;
 I chose to first create an &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/ms173156.aspx&quot; target=&quot;_msdn&quot;&gt;Interface&lt;/a&gt;. I created this because I needed to extend both &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;GameComponent&lt;/a&gt; and also &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.drawablegamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;DrawableGameComponent&lt;/a&gt;, but I wanted to extend both of them in the same way and wanted to make sure each new extended class would adhere to a set of rules about its structure. If you are not familiar with &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/ms173156.aspx&quot; target=&quot;_msdn&quot;&gt;Interfaces&lt;/a&gt;, see &lt;a href=&quot;http://jsedlak.org/node/132&quot;&gt;this great post&lt;/a&gt; on &lt;a href=&quot;http://jsedlak.org&quot;&gt;jsedlak.org&lt;/a&gt; for an introduction about them.
 &lt;br /&gt;
 &lt;br /&gt;
 So, let&#39;s start with the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/ms173156.aspx&quot; target=&quot;_msdn&quot;&gt;Interface&lt;/a&gt; code. It&#39;s a pretty simple &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/ms173156.aspx&quot; target=&quot;_msdn&quot;&gt;Interface&lt;/a&gt;, not much going on. Remember, we are only extending the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;GameComponent&lt;/a&gt; class to add 3 things: a way to keep track of the previous &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.enabled.aspx&quot; target=&quot;_msdn&quot;&gt;Enabled&lt;/a&gt; state, an &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/system.eventhandler.aspx&quot; target=&quot;_msdn&quot;&gt;EventHandler&lt;/a&gt; for &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.activated.aspx&quot; target=&quot;_msdn&quot;&gt;Game.Activated&lt;/a&gt;, and an &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/system.eventhandler.aspx&quot; target=&quot;_msdn&quot;&gt;EventHandler&lt;/a&gt; for &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.deactivated.aspx&quot; target=&quot;_msdn&quot;&gt;Game.Deactivated&lt;/a&gt;. Ideally, by using an &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/ms173156.aspx&quot; target=&quot;_msdn&quot;&gt;Interface&lt;/a&gt;, I leave the ability to easily add other features later if needed and still make sure that my new extended classes adhere to a structure.
 &lt;!-- code formatted by http://tehone.com/utils/SourceFormat/ --&gt;
 &lt;div class=&quot;tosf tosf450&quot;&gt;
  &lt;div class=&quot;toolbar&quot;&gt;
  &lt;div class=&quot;toolbar-showplain&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;plaintext&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;plaintext&#39;);&quot; /&gt;Show Plain Text&lt;/div&gt;
  &lt;div class=&quot;toolbar-showlinenums&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;linenumbers&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;linenumbers&#39;);&quot; /&gt;Show Line #&lt;/div&gt;
  &lt;div class=&quot;toolbar-showaltlines&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;altlines&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;altlines&#39;);&quot; /&gt;Alternating Lines&lt;/div&gt;
  &lt;div class=&quot;toolbar-hiderem&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;hiderem&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;hiderem&#39;);&quot; /&gt;Hide Comments&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;tosfInner tosfInner450&quot;&gt;
  &lt;ol class=&quot;formatted tabSpacing2 OutsideDecimal&quot;&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; TehOne.Xna.GameComponents&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;{&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// This &amp;lt;c&amp;gt;interface&amp;lt;/c&amp;gt; is used to help extend the base &amp;lt;see cref=&quot;Microsoft.Xna.Framework.GameComponent&quot;/&amp;gt; object.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;para&amp;gt;We add the &amp;lt;see cref=&quot;PreviouslyEnabled&quot;/&amp;gt; field and an &amp;lt;see cref=&quot;System.EventHandler&quot;/&amp;gt; method for handling the &amp;lt;see cref=&quot;Microsoft.Xna.Framework.GameComponent.EnabledChanged&quot;/&amp;gt; event.&amp;lt;/para&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;interface&lt;/span&gt; IXnaGameComponent&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// The PreviouslyEnabled property represents the previous value of &amp;lt;see cref=&quot;Microsoft.Xna.Framework.GameComponent.Enabled&quot;/&amp;gt; for this &amp;lt;see cref=&quot;IXnaGameComponent&quot;/&amp;gt;.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; PreviouslyEnabled&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// This method is the &amp;lt;see cref=&quot;System.EventHandler&quot;/&amp;gt; for the &amp;lt;see cref=&quot;Microsoft.Xna.Framework.Game.Activated&quot;/&amp;gt; event.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;sender&quot;&amp;gt;The &amp;lt;see cref=&quot;System.Object&quot;/&amp;gt; that called this event.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;e&quot;&amp;gt;The arguments that were passed into this event.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Game_Activated(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs args);&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// This method is the &amp;lt;see cref=&quot;System.EventHandler&quot;/&amp;gt; for the &amp;lt;see cref=&quot;Microsoft.Xna.Framework.Game.Deactivated&quot;/&amp;gt; event.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;sender&quot;&amp;gt;The &amp;lt;see cref=&quot;System.Object&quot;/&amp;gt; that called this event.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;e&quot;&amp;gt;The arguments that were passed into this event.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Game_Deactivated(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs args);&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;}&lt;/div&gt;&lt;/li&gt;
  &lt;/ol&gt;
  &lt;/div&gt;
 &lt;/div&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 Ok, so from here, we need to create 2 classes that implement the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/ms173156.aspx&quot; target=&quot;_msdn&quot;&gt;Interface&lt;/a&gt; we just created and extend a base class from the &lt;a href=&quot;http://msdn.microsoft.com/xna/&quot; target=&quot;_msdn&quot;&gt;XNA&lt;/a&gt; framework. One that extends &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;GameComponent&lt;/a&gt; and one that extends &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.drawablegamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;DrawableGameComponent&lt;/a&gt;. The 2 new classes are basically exactly the same. The only difference is the base class which they extend.
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;!-- code formatted by http://tehone.com/utils/SourceFormat/ --&gt;
 &lt;div class=&quot;tosf tosf450&quot;&gt;
  &lt;div class=&quot;toolbar&quot;&gt;
  &lt;div class=&quot;toolbar-showplain&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;plaintext&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;plaintext&#39;);&quot; /&gt;Show Plain Text&lt;/div&gt;
  &lt;div class=&quot;toolbar-showlinenums&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;linenumbers&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;linenumbers&#39;);&quot; /&gt;Show Line #&lt;/div&gt;
  &lt;div class=&quot;toolbar-showaltlines&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;altlines&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;altlines&#39;);&quot; /&gt;Alternating Lines&lt;/div&gt;
  &lt;div class=&quot;toolbar-hiderem&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;hiderem&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;hiderem&#39;);&quot; /&gt;Hide Comments&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;tosfInner tosfInner500&quot;&gt;
  &lt;ol class=&quot;formatted tabSpacing2 OutsideDecimal&quot;&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Microsoft.Xna.Framework;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; TehOne.Xna.GameComponents&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;{&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// This &amp;lt;c&amp;gt;partial class&amp;lt;/c&amp;gt; is used to extend the base &amp;lt;see cref=&quot;Microsoft.Xna.Framework.DrawableGameComponent&quot;/&amp;gt; object.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;para&amp;gt;Implements the members of &amp;lt;see cref=&quot;IXnaGameComponent&quot;/&amp;gt;.&amp;lt;/para&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; XnaDrawableGameComponent : Microsoft.Xna.Framework.DrawableGameComponent, IXnaGameComponent&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; _previouslyEnabled = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// The PreviouslyEnabled property represents the previous value of &amp;lt;see cref=&quot;Microsoft.Xna.Framework.GameComponent.Enabled&quot;/&amp;gt; for this &amp;lt;see cref=&quot;Microsoft.Xna.Framework.GameComponent&quot;/&amp;gt;.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;value&amp;gt;The PreviouslyEnabled property gets/sets the &amp;lt;see cref=&quot;_previouslyEnabled&quot;/&amp;gt; data member.&amp;lt;/value&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;remarks&amp;gt;The value of the &amp;lt;see cref=&quot;_previouslyEnabled&quot;/&amp;gt; data member is set when the &amp;lt;see cref=&quot;OnEnabledChange(object, EventArgs)&quot;/&amp;gt; event is fired.&amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; PreviouslyEnabled&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; _previouslyEnabled;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_previouslyEnabled = &lt;span class=&quot;kwrd&quot;&gt;value&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// The main constructor for &amp;lt;see cref=&quot;XnaDrawableGameComponent&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;game&quot;&amp;gt;The &amp;lt;see cref=&quot;Microsoft.Xna.Framework.Game&quot; /&amp;gt; instance.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; XnaDrawableGameComponent(Game game)&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;: &lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;(game)&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;game.Activated += &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; EventHandler(Game_Activated);&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;game.Deactivated += &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; EventHandler(Game_Deactivated);&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// This method is the &amp;lt;see cref=&quot;System.EventHandler&quot;/&amp;gt; for the &amp;lt;see cref=&quot;Microsoft.Xna.Framework.Game.Activated&quot;/&amp;gt; event.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;sender&quot;&amp;gt;The &amp;lt;see cref=&quot;System.Object&quot;/&amp;gt; that called this event.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;e&quot;&amp;gt;The arguments that were passed into this event.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;remarks&amp;gt;When this &amp;lt;see cref=&quot;System.EventHandler&quot;/&amp;gt; is fired, we set our &amp;lt;see cref=&quot;Microsoft.Xna.Framework.GameComponent.Enabled&quot;/&amp;gt; value to be the value of the &amp;lt;see cref=&quot;_previouslyEnabled&quot;/&amp;gt; data member.&amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Game_Activated(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Enabled = _previouslyEnabled;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// This method is the &amp;lt;see cref=&quot;System.EventHandler&quot;/&amp;gt; for the &amp;lt;see cref=&quot;Microsoft.Xna.Framework.Game.Deactivated&quot;/&amp;gt; event.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;sender&quot;&amp;gt;The &amp;lt;see cref=&quot;System.Object&quot;/&amp;gt; that called this event.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;param name=&quot;e&quot;&amp;gt;The arguments that were passed into this event.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;remarks&amp;gt;When this &amp;lt;see cref=&quot;System.EventHandler&quot;/&amp;gt; is fired, we set our &amp;lt;see cref=&quot;_previouslyEnabled&quot;/&amp;gt; data member value to be the value of &amp;lt;see cref=&quot;Microsoft.Xna.Framework.GameComponent.Enabled&quot;/&amp;gt;. Then, we set our &amp;lt;see cref=&quot;Microsoft.Xna.Framework.GameComponent.Enabled&quot;/&amp;gt; state to &amp;lt;b&amp;gt;&amp;lt;c&amp;gt;false&amp;lt;/c&amp;gt;&amp;lt;/b&amp;gt;.&amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Game_Deactivated(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_previouslyEnabled = &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Enabled;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Enabled = &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// Allows the game component to perform any initialization it needs to before starting&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// to run.&amp;nbsp;&amp;nbsp;This is where it can query for any required services and load content.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;rem&quot;&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Initialize()&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_previouslyEnabled = &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.Enabled;&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;.Initialize();&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/div&gt;&lt;/li&gt;
  &lt;li&gt;&lt;div&gt;}&lt;/div&gt;&lt;/li&gt;
  &lt;/ol&gt;
  &lt;/div&gt;
 &lt;/div&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 Ok, so that is all we need. Now, when we create a custom &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;GameComponent&lt;/a&gt; or &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.drawablegamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;DrawableGameComponent&lt;/a&gt; we will just have it extend from one of these 2 new classes. As an example:
 &lt;!-- code formatted by http://tehone.com/utils/SourceFormat/ --&gt;
 &lt;div class=&quot;tosf tosf450&quot;&gt;
  &lt;div class=&quot;toolbar&quot;&gt;
  &lt;div class=&quot;toolbar-showplain&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;plaintext&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;plaintext&#39;);&quot; /&gt;Show Plain Text&lt;/div&gt;
  &lt;div class=&quot;toolbar-showlinenums&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;linenumbers&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;linenumbers&#39;);&quot; /&gt;Show Line #&lt;/div&gt;
  &lt;div class=&quot;toolbar-showaltlines&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;altlines&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; checked=&quot;checked&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;altlines&#39;);&quot; /&gt;Alternating Lines&lt;/div&gt;
  &lt;div class=&quot;toolbar-hiderem&quot; onclick=&quot;TOSF.SourceFormatToggle(this, &#39;hiderem&#39;);&quot;&gt;&lt;input type=&quot;checkbox&quot; onclick=&quot;TOSF.SourceFormatToggle(this.parentNode, &#39;hiderem&#39;);&quot; /&gt;Hide Comments&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;tosfInner&quot;&gt;
  &lt;ol class=&quot;formatted tabSpacing2 OutsideDecimal&quot;&gt;
  &lt;li class=&quot;alt&quot;&gt;&lt;div&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Framerate : XnaDrawableGameComponent&lt;/div&gt;&lt;/li&gt;
  &lt;/ol&gt;
  &lt;/div&gt;
 &lt;/div&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 That&#39;s all there is too it. Now any &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.gamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;GameComponent&lt;/a&gt; that use &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_01/docs/html/6128a112-ef2b-179e-3237-3c7692a91d8d.htm&quot; target=&quot;_webDocs&quot;&gt;XnaGameComponent&lt;/a&gt; as it&#39;s base class, or any &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.drawablegamecomponent.aspx&quot; target=&quot;_msdn&quot;&gt;DrawableGameComponent&lt;/a&gt; that use &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_01/docs/html/7d99da99-dd53-be8e-db99-4675e5f457f8.htm&quot; target=&quot;_webDocs&quot;&gt;XnaDrawableGameComponent&lt;/a&gt; as it&#39;s base class, will automatically be disabled when the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.aspx&quot; target=&quot;_msdn&quot;&gt;Game&lt;/a&gt; is &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.deactivated.aspx&quot; target=&quot;_msdn&quot;&gt;Deactivated&lt;/a&gt; and they will re-enable (if they were enabled before the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.deactivated.aspx&quot; target=&quot;_msdn&quot;&gt;Deactivate&lt;/a&gt;) themselves when the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.aspx&quot; target=&quot;_msdn&quot;&gt;Game&lt;/a&gt; is &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/microsoft.xna.framework.game.activated.aspx&quot; target=&quot;_msdn&quot;&gt;Activated&lt;/a&gt;.
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;div class=&quot;DownloadCodeLinkWrapper&quot;&gt;
  You can download the full source code here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_01/TehOne.Xna.GameComponents.zip&quot;&gt;TehOne.Xna.GameComponents.zip&lt;/a&gt;
  &lt;br /&gt;
  The online documentation is here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_01/docs/&quot; target=&quot;_webDocs&quot;&gt;Documentation&lt;/a&gt;
  &lt;br /&gt;
  The offline documentation is here: &lt;a href=&quot;http://tehone.com/xna/blogger/2007_03_01/docs/Documentation.chm&quot;&gt;Documentation.chm&lt;/a&gt; (recommended)
 &lt;/div&gt;
 &lt;br /&gt;
 I hope this code proves usefull for others. Any comments/suggestions/feedback?
 &lt;br /&gt;
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.tehone.com/feeds/886560441147342256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30411126&amp;postID=886560441147342256' title='364 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/886560441147342256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/886560441147342256'/><link rel='alternate' type='text/html' href='http://blog.tehone.com/2007/03/enabling-disabling-gamecomponents-when.html' title='Enabling-Disabling GameComponents when a game is Activated-Deactivated'/><author><name>TehOne</name><uri>http://www.blogger.com/profile/04537679822648159970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>364</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30411126.post-5840167743310699543</id><published>2007-02-28T18:53:00.000-08:00</published><updated>2007-03-01T15:06:40.011-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Development"/><category scheme="http://www.blogger.com/atom/ns#" term="DrawableGameComponent"/><category scheme="http://www.blogger.com/atom/ns#" term="Game"/><category scheme="http://www.blogger.com/atom/ns#" term="GameComponent"/><category scheme="http://www.blogger.com/atom/ns#" term="GameDev"/><category scheme="http://www.blogger.com/atom/ns#" term="General"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming"/><category scheme="http://www.blogger.com/atom/ns#" term="Xna"/><title type='text'>Getting Started</title><content type='html'>Ok.  So a little about me.  I&#39;ve been a programmer since 1995.  I&#39;ve worked mostly on non-public facing websites for small to medium sized companies.  I have a degree in Computer Sciences, and so I of course did take C and C++ in school.  But, since then I have rarely used either and so now prefer to avoid both if I can.  I also have some experience with Java and JSP.  However, I have done mostly all Microsoft technologies related programming in my professional career.  I have done tons of ASP and VB Script coding over the last 10 years.  But ever since the first or second beta of ASP.Net I have been working mostly with it using the C# language.
&lt;br/&gt;&lt;br/&gt;
Ever since I can remember, I have also been a gamer at heart.  I&#39;ve probably never been through a time in my life when I didn&#39;t have some kind of game console hooked up to my TV.  As I got older, I started to get more into PC gaming though.  And with this, came the possibility and desire to make/mod games.  This has been a thought in the back of my mind for a long time now, but I never started really diving into it.  My reasons for not starting on it are basically: 1. Being too busy to make time for it (see: &lt;a href=&quot;http://dictionary.reference.com/search?q=procrastination&quot;&gt;Procrastination&lt;/a&gt;) and 2. Barrier to entry. Reason #2 is what I think was my biggest reason that I never got started.  As I said above, I haven&#39;t done C++ since my school days.  And since the majority of games are made in C++, I wasn&#39;t very motivated to jump right in.  Another facet of #2 is cost.  As I think most of us are aware of, the cost of making a game has skyrocketed over the last decade or so.  Now, I know this doesn&#39;t affect indie game makers that much, but it still weighed in on my mind.  I would have probably wanted to license/use a game engine since I had limited experience with game design.  I am also not a 3D modeler either, so I probably would have needed to either contract out to one or pay for some pre-made models.  I am also not an artist, so again I would have had to contract out to one or hire one, or purchase some pre-made stuff.
&lt;br/&gt;&lt;br/&gt;
&lt;span class=&quot;fullpost&quot;&gt;&lt;a name=&quot;ReadMore&quot;&gt;&lt;/a&gt;So, with all those worries in my mind, I thought I would start smaller.  Since I was (and still am) a very dedicated &lt;a href=&quot;http://www.dayofdefeat.com/&quot;&gt;Day of Defeat&lt;/a&gt; gamer, I decided that I would try to make some maps for the game.  I downloaded their map/world editor and got to playing around.  It wasn&#39;t the easiest to use, and the new release of the game (Day of Defeat:Source, using Valves Source game engine) and it&#39;s map/world editor was coming soon, so I never made a map for the game.  So, when they release the new map/world editor, I got into it again and map a few sample maps.  This was before the new game came out though.  So I was just testing the editor and viewing them in Half Life2.  Finally, the new game came out, and unfortunately it didn&#39;t live up to my expectations and I had no interest in playing the new version of the game.  And of course, with that went my desire to make maps for it.
&lt;br/&gt;&lt;br/&gt;
Ok, so on to today in the gaming market.  For one, I have been playing more and more games over the years, and it seems with the more I play, the more I want to get into game development.  And, I think today there are more things available for free/inexpensive then ever before too.  There are a number of open source and free game engines.  There are a number of free/inexpensive assets out there too, from textures, models etc...  And, now there is &lt;a href=&quot;http://msdn.microsoft.com/xna/&quot;&gt;XNA&lt;/a&gt; and &lt;a href=&quot;http://msdn2.microsoft.com/en-us/directx/aa937795.aspx&quot;&gt;Game Studio Express (GSE)&lt;/a&gt;.  With these two new tools, game developing has taken another step in the right direction to lower the barrier to entry into game development.  With these new technologies/tools, my interest in game design has again been peaked.  So, I think to start, I will just make some 2D games.  Maybe puzzle/ball games (see: &lt;a href=&quot;http://en.wikipedia.org/wiki/Zuma_%28computer_game%29&quot;&gt;Zuma&lt;/a&gt;, &lt;a href=&quot;http://www.gamehouse.com/gamedetails/?game=luxoramunr&quot;&gt;Luxor - Amun Rising&lt;/a&gt;) or just simple games in general.
&lt;br/&gt;&lt;br/&gt;
Along my journey into game development, I will be posting some code and looking for feedback/comments/suggestions. I also hope to develop some good re-usable code (class libraries) and some &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/bb203873.aspx#ID2EXF&quot;&gt;GameComponents&lt;/a&gt; for others to use.  Hopefully I&#39;ll develop some stuff that will be useful for others that are new to game development.  And hopefully for anything that I publish, people will provide me with some feedback on it with some criticisms  and or suggestions.
&lt;br/&gt;&lt;br/&gt;
I expect to publish my first &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/bb203873.aspx#ID2EXF&quot;&gt;GameComponents&lt;/a&gt; in the next few days or so.  There will be one for Framerate calculation and display (probably similar to a lot of other Framerate components that are already out there), and more importantly, one for Mouse related stuff.  Like using a custom pointer and also an event driven system for movement/clicks/scrolls.
&lt;br/&gt;&lt;br/&gt;
Well, I hope that this gives a clear introduction of who I am and what my current/thoughts and goals are.
&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.tehone.com/feeds/5840167743310699543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30411126&amp;postID=5840167743310699543' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/5840167743310699543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30411126/posts/default/5840167743310699543'/><link rel='alternate' type='text/html' href='http://blog.tehone.com/2007/02/getting-started.html' title='Getting Started'/><author><name>TehOne</name><uri>http://www.blogger.com/profile/04537679822648159970</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>