<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MonoGame | Learn C Games Programming Blog</title>
	<atom:link href="https://learncgames.com/category/monogame/feed/" rel="self" type="application/rss+xml" />
	<link>https://learncgames.com</link>
	<description>A blog about C, programming games and my ebook(s).</description>
	<lastBuildDate>Tue, 22 Sep 2020 10:03:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://learncgames.com/wp-content/uploads/2020/03/cropped-favicon-32x32.png</url>
	<title>MonoGame | Learn C Games Programming Blog</title>
	<link>https://learncgames.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">181446779</site>	<item>
		<title>An example of what you can do with MonoGame</title>
		<link>https://learncgames.com/an-example-of-what-you-can-do-with-monogame/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=an-example-of-what-you-can-do-with-monogame</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Wed, 23 Sep 2020 23:00:20 +0000</pubDate>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[MonoGame]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Final Fantasy VIII]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=1441</guid>

					<description><![CDATA[<p>MonoGame is not just for mobile, as I&#8217;ve been doing. Open VIII is a Final Fantasy VIII game engine written in C#/MonoGame and currently works on Windows and Linux (not sure about Mac). Other games in the series have been ported to other platforms but not FFVIII, so that&#8217;s why the project was started. The [&#8230;]</p>
The post <a href="https://learncgames.com/an-example-of-what-you-can-do-with-monogame/">An example of what you can do with MonoGame</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:505,&quot;href&quot;:&quot;https:\/\/github.com\/MaKiPL\/OpenVIII-monogame&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260203163740\/https:\/\/github.com\/MaKiPL\/OpenVIII-monogame&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 15:35:11&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-10 08:45:18&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-15 13:30:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-21 00:04:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-24 15:37:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-28 13:36:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-06 03:16:27&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-11 23:52:39&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-15 14:58:22&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-21 17:14:02&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-27 02:28:03&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-02 12:12:51&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-08 08:42:33&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-13 13:39:19&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-17 03:59:57&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-20 10:04:03&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-23 17:38:38&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-23 17:38:38&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]'></div>
<p><img fetchpriority="high" decoding="async" class="alignleft size-medium wp-image-1442" src="https://learncgames.com/wp-content/uploads/2020/09/fightingfantasyVIII-clone-300x167.png" alt="OpenVIII screenshot" width="300" height="167" srcset="https://learncgames.com/wp-content/uploads/2020/09/fightingfantasyVIII-clone-300x167.png 300w, https://learncgames.com/wp-content/uploads/2020/09/fightingfantasyVIII-clone.png 650w" sizes="(max-width: 300px) 100vw, 300px" />MonoGame is not just for mobile, as I&#8217;ve been doing. <a title="Link to Open VIII on GitHub" href="https://github.com/MaKiPL/OpenVIII-monogame" target="_blank" rel="nofollow noopener noreferrer">Open VIII</a> is a Final Fantasy VIII game engine written in C#/MonoGame and currently works on Windows and Linux (<em>not sure about Mac</em>). Other games in the series have been ported to other platforms but not FFVIII, so that&#8217;s why the project was started.</p>
<p>The instructions for Open VIII on Windows suggest Visual Studio 2017 but I imagine 2019 might also work as MonoGame 3.8 has templates for it.  As the project says &#8220;<em>OpenVIII is an open-source complete <strong>Final Fantasy VIII</strong> game engine rewrite from scratch powered in OpenGL making it possible to play the vanilla game on wide variety of platforms including <strong>Windows 32/64 bit</strong>, <strong>Linux 32/64 bit</strong> and even <strong>mobile</strong>!</em>&#8221;</p>
<p>As with virtually all open source reimplementations, you will have to provide your own game assets such as images and sound. You can do this apparently by buying the original game on Steam. I took a look and sure enough it&#8217;s there and there&#8217;s an official remastering by Square Enix. I&#8217;m not sure why the Steam search brings up FF VII as well but hey that&#8217;s search for you&#8230; I&#8217;ve added a permanent link to the C#/MonoGame links page.</p>
<p><img decoding="async" class="alignleft size-full wp-image-1443" src="https://learncgames.com/wp-content/uploads/2020/09/steam-finalfantasyVIII.png" alt="Steam Final Fantasy VIII" width="434" height="216" srcset="https://learncgames.com/wp-content/uploads/2020/09/steam-finalfantasyVIII.png 434w, https://learncgames.com/wp-content/uploads/2020/09/steam-finalfantasyVIII-300x149.png 300w" sizes="(max-width: 434px) 100vw, 434px" /></p>The post <a href="https://learncgames.com/an-example-of-what-you-can-do-with-monogame/">An example of what you can do with MonoGame</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1441</post-id>	</item>
		<item>
		<title>Monogame 3.8 is now out</title>
		<link>https://learncgames.com/monogame-3-8-is-now-out/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=monogame-3-8-is-now-out</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Tue, 18 Aug 2020 23:00:02 +0000</pubDate>
				<category><![CDATA[MonoGame]]></category>
		<category><![CDATA[news]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=1210</guid>

					<description><![CDATA[<p>These don&#8217;t come that often and this one has quite a few changes. You can read all about it on their What New page.  The main changes as far as I am concerned is the .NET Core support, templates in VS 2019 (finally!) and distribution via Nuget. Interesting though that the Pipeline tool is dead, [&#8230;]</p>
The post <a href="https://learncgames.com/monogame-3-8-is-now-out/">Monogame 3.8 is now out</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:563,&quot;href&quot;:&quot;https:\/\/docs.monogame.net\/articles\/whats_new.html&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20250923135527\/https:\/\/docs.monogame.net\/articles\/whats_new.html&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 16:19:30&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-12 18:28:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-18 16:22:24&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-22 21:21:14&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-26 21:26:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-06 08:10:42&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-10 08:29:42&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-13 17:57:31&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-17 08:06:54&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-24 21:52:59&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-30 00:09:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-03 09:31:15&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-08 11:23:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-13 13:39:19&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-23 17:38:38&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-23 17:38:38&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:564,&quot;href&quot;:&quot;https:\/\/docs.monogame.net\/articles\/migrate_37.html&quot;,&quot;archived_href&quot;:&quot;&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;}]'></div>
<p><img decoding="async" class="alignleft size-medium wp-image-1211" src="https://learncgames.com/wp-content/uploads/2020/08/monogame-3.8-released-300x110.png" alt="Monogame 3.8 released" width="300" height="110" srcset="https://learncgames.com/wp-content/uploads/2020/08/monogame-3.8-released-300x110.png 300w, https://learncgames.com/wp-content/uploads/2020/08/monogame-3.8-released.png 716w" sizes="(max-width: 300px) 100vw, 300px" />These don&#8217;t come that often and this one has quite a few changes. You can read all about it on their <a title="Link to whats new in Monogame 3.8" href="https://docs.monogame.net/articles/whats_new.html" target="_blank" rel="nofollow noopener noreferrer">What New</a> page.  The main changes as far as I am concerned is the .NET Core support, templates in VS 2019 (finally!) and distribution via Nuget.</p>
<p>Interesting though that the Pipeline tool is dead, Long live the Pipeline! It&#8217;s now called the MCGB tool. I think it&#8217;s more a rebranding than completely new or maybe it is (<em>apologies if that&#8217;s the case</em>). And I notice that text is a resource type that you can add BUT on Android, no point in compressing things because apks are compressed anyway. <strong>Here&#8217;s a big secret,</strong> apk files, like Java .jar files are just <em>zip</em> files.  Yes you can view their contents with WinZip!</p>
<p>If you are a 3.7 MonoGame user (<em>as I am</em>), you should probably readthe <a title="Link to migrate from 3.7 web page" href="https://docs.monogame.net/articles/migrate_37.html" target="_blank" rel="nofollow noopener noreferrer">migrating from 3.7 web page</a>.</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/monogame-3-8-is-now-out/">Monogame 3.8 is now out</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1210</post-id>	</item>
		<item>
		<title>MonoGame &#8211; How to make a clickable button</title>
		<link>https://learncgames.com/monogame-how-to-make-a-clickable-button/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=monogame-how-to-make-a-clickable-button</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Fri, 14 Aug 2020 23:00:25 +0000</pubDate>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[MonoGame]]></category>
		<category><![CDATA[Source code]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[clickable]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=1169</guid>

					<description><![CDATA[<p>I&#8217;m using this in Android games but the principle applies to any MonoGame game. Here clickable and touchable mean the same. You need three things to make something clickable. The area. For simplicity sake this will always be rectangular. The Action. When you touch (or click it), you want it to run code. An id [&#8230;]</p>
The post <a href="https://learncgames.com/monogame-how-to-make-a-clickable-button/">MonoGame – How to make a clickable button</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignleft size-full wp-image-1171" src="https://learncgames.com/wp-content/uploads/2020/08/clearButton.png" alt="Clear Button with one card clicked" width="477" height="513" srcset="https://learncgames.com/wp-content/uploads/2020/08/clearButton.png 477w, https://learncgames.com/wp-content/uploads/2020/08/clearButton-279x300.png 279w" sizes="auto, (max-width: 477px) 100vw, 477px" />I&#8217;m using this in Android games but the principle applies to any MonoGame game. Here clickable and touchable mean the same.</p>
<p>You need three things to make something clickable.</p>
<ol>
<li>The area. For simplicity sake this will always be rectangular.</li>
<li>The Action. When you touch (or click it), you want it to run code.</li>
<li>An id of sorts. If you have multiple buttons etc, you meed to distinguish them.</li>
</ol>
<p>We&#8217;ll use an int for 3. Use const ints to give it a name rather than being a magic number.</p>
<p>&nbsp;</p>
<p>When you click whatever, the Event should include the ide so let&#8217;s define the event Type first.</p>
<pre><code class="language-csharp" data-line="">public class ButtonClickedEventArgs : EventArgs
{
    public int Id { get; set; }
}</code></pre>
<p>Not rocket science is it!</p>
<p>Now lets define a ClickButton class.</p>
<pre><code class="language-csharp" data-line="">public class ClickButton
{
    public int Id { get; set; }
    public Rectangle TouchArea { get; set; }
    public Action&lt;object, ButtonClickedEventArgs&gt; AnAction { get; set; } = null;

    public ClickButton(int id)
    {
        Id = id;
        TouchArea = new Rectangle(0, 0, 0, 0);
    }
}</code></pre>
<p>Again nothing too complicated. There&#8217;s an int Id which which is set in the Constructor, a Rectangle TouchArea and an Action which is defined to include our ButtonClickedEventArgs.</p>
<p>Here;&#8217;s some example code. I&#8217;ve defined a graphic for a Clear button in my game and this is loaded as usual in the LoadContent().  I&#8217;ve also defined the button in Class declaration.</p>
<pre>ClickButton ClearButton;</pre>
<p>In LoadControl(), this is also initialised. Here&#8217;s it&#8217;s two line. It could be done in one, by altering the constuctor.</p>
<pre><code class="language-csharp" data-line="">ClearButton = new ClickButton(1);  // 1 is the id
ClearButton.AnAction += ClearCards;</code></pre>
<p>ClearCards is a method that does something when the button is cleared. This matches our Event handler as it has the usal two parameters for an Event except the args is our ButtonClickedEventArgs.</p>
<pre><code class="language-csharp" data-line="">private void ClearCards(object sender, ButtonClickedEventArgs args)  {
   // all the code here, not shown
}</code></pre>
<h2>Where is the TouchArea defined?</h2>
<p>So are we all setup ready to rock&#8217;n&#8217;roll? Well not quite. We haven&#8217;t said exactly where the TouchArea is. That of course depends on where we draw the button. In my game, the ClearButton moves across. It&#8217;s absent when all six cards are present but as soon as one has been touched and a back card touched to move it, the Clear Card appears. In the top image you can see it to the right of the five top cards. I had clicked the seven of clubs when it was in the top row then the first back on the top row of the three rows.</p>
<p>For my next move I clicked the ten of diamonds and the second back on that first row where the ten of diamonds no wit. It now looks like this and the Clear Button has moved over.  If I click the Clear button it will move the seven clubs and ten diamonds back to the top row and replace them in the first row with backs.</p>
<p><img loading="lazy" decoding="async" class="alignleft size-full wp-image-1172" src="https://learncgames.com/wp-content/uploads/2020/08/ClearButtin2.png" alt="Second click" width="480" height="510" srcset="https://learncgames.com/wp-content/uploads/2020/08/ClearButtin2.png 480w, https://learncgames.com/wp-content/uploads/2020/08/ClearButtin2-282x300.png 282w" sizes="auto, (max-width: 480px) 100vw, 480px" />To set the TouchArea of the ClearButton, I do it in the Draw method. It&#8217;s as simple as this:</p>
<pre><code class="language-csharp" data-line="">if (hand.Count &lt; 6) // Draw ClearButton on end
  {
    spriteBatch.Draw(clearButton, new Rectangle(x, y, cardWidth, cardHeight), 
        new Rectangle(0, 0, cardWidth, cardHeight), Color.White);
    ClearButton.TouchArea = new Rectangle(x, y, cardWidth, cardHeight);
  }</code></pre>
<p>There&#8217;s actually a small bug visible. When you click a top row card, the game highlights it by reducing its opacity to 0.5. If you look at the ten of diamonds, you can see it still has that reduced opacity; it should have been restored to 1.0 when it was moved to the first row. The same is true in the top picture for the seven clubs! Easily overlooked but just a one-line fix.</p>
<h2>Some Touchy Code</h2>
<p>The very last bit is to fire touch detection and this is done in the <strong>Update()</strong> method. When you touch the screen, calling <strong>Touchpanel.GetState()</strong> returns a collection of touches. This is my code. It cycles through the touches collection, gets the X, Y position of each touch and adjusts it to match the virtual screen coordinates. (<em>Drawing to a virtual screen means this looks the same on every Android irrespective of its physical screen sizes and resolution</em>).</p>
<pre><code class="language-csharp" data-line="">touchState = TouchPanel.GetState();
foreach (var touch in touchState)
{
   if (touch.State == TouchLocationState.Pressed)
    {
         var x = touch.Position.X / xRatio; // adjust for virtual screen
         var y = touch.Position.Y / yRatio;
         CheckClickedTop(x, y, hand);
         if (pickedCard == null) return; // no point checking further...
         for (var i = 0; i &lt; 3; i++)
            CheckClickedBottom(x, y, commonCards[i], true);
            if (hand.Count == 6) continue; // All top cards so no ClearButton visible
            // Check if Clear button
            if (ClearButton.TouchArea.Contains(x, y))
              {
                  ClearButton.AnAction(ClearButton, new ButtonClickedEventArgs() { Id = ClearButton.Id }); 
              }
      }
}</code></pre>
<p>The top cards are held in a class called hand and the bottom three rows are held in CommonCards[3] each of which is a hand. The CheckClicked.. methods cycle through the cards in the hand comparing coordinates to see which card if at all has been clicked. If it has it calls the AnAction Event for the one clicked.  The very last if shows how this works to check if the ClearButton was clicked. I&#8217;ll simplify this code by moving it into a ClickButton method.</p>The post <a href="https://learncgames.com/monogame-how-to-make-a-clickable-button/">MonoGame – How to make a clickable button</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1169</post-id>	</item>
		<item>
		<title>An irritating bug with MonoGame/Android</title>
		<link>https://learncgames.com/an-irritating-bug-with-monogame-android/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=an-irritating-bug-with-monogame-android</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Fri, 07 Aug 2020 23:00:48 +0000</pubDate>
				<category><![CDATA[mobile]]></category>
		<category><![CDATA[MonoGame]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[bug]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=1133</guid>

					<description><![CDATA[<p>Bugs happen, it&#8217;s a way of life but when the bug affects you as a developer, it can be a tad annoying. I&#8217;ve found a bug and mentioned it in the MonoGame forums. The bug occurs intermittently. I do a build then run the program on an Android phone. It starts loading, shows the splash [&#8230;]</p>
The post <a href="https://learncgames.com/an-irritating-bug-with-monogame-android/">An irritating bug with MonoGame/Android</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:584,&quot;href&quot;:&quot;https:\/\/pixabay.com\/users\/thommas68-2571842\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2435642&quot;,&quot;archived_href&quot;:&quot;&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:585,&quot;href&quot;:&quot;https:\/\/pixabay.com\/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2435642&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260205102120\/https:\/\/pixabay.com\/?utm_source=link-attribution&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 16:29:32&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-12 18:28:39&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-15 19:42:41&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-22 21:21:30&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-02-26 06:49:26&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-06 23:28:36&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-17 08:06:49&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-24 21:52:53&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-03-30 00:09:32&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-03 06:05:50&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-07 18:14:35&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-13 00:41:44&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-16 23:23:24&quot;,&quot;http_code&quot;:403},{&quot;date&quot;:&quot;2026-04-21 01:38:41&quot;,&quot;http_code&quot;:403}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-21 01:38:41&quot;,&quot;http_code&quot;:403},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:586,&quot;href&quot;:&quot;https:\/\/community.monogame.net&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260117005522\/https:\/\/community.monogame.net\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 16:29:35&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-12 18:28:36&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-15 19:42:41&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-22 21:21:31&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-26 06:49:27&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-06 23:28:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-17 08:06:52&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-24 21:52:57&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-30 00:09:35&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-03 06:05:51&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-07 18:14:36&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-12 21:22:31&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-16 23:23:29&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-21 01:38:36&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-21 01:38:36&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]'></div>
<figure id="attachment_1134" aria-describedby="caption-attachment-1134" style="width: 300px" class="wp-caption alignleft"><img loading="lazy" decoding="async" class="size-medium wp-image-1134" src="https://learncgames.com/wp-content/uploads/2020/08/phone-2435642_640-300x225.png" alt="Android Phone" width="300" height="225" srcset="https://learncgames.com/wp-content/uploads/2020/08/phone-2435642_640-300x225.png 300w, https://learncgames.com/wp-content/uploads/2020/08/phone-2435642_640.png 640w" sizes="auto, (max-width: 300px) 100vw, 300px" /><figcaption id="caption-attachment-1134" class="wp-caption-text">Image by <a href="https://pixabay.com/users/thommas68-2571842/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2435642">Iván Tamás</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=2435642">Pixabay</a></figcaption></figure>
<p>Bugs happen, it&#8217;s a way of life but when the bug affects you as a developer, it can be a tad annoying. I&#8217;ve found a bug and mentioned it in the <a title="Link to official Monogame forums" href="https://community.monogame.net/" target="_blank" rel="nofollow noopener noreferrer">MonoGame forums</a>.</p>
<p>The bug occurs intermittently. I do a build then run the program on an Android phone. It starts loading, shows the splash screen then splat &#8220;The Content file was not found&#8221; message appears in Visual Studio.</p>
<p>This may be a bug in Xamarin or MonoGame. No doubt it will eventually get fixed but still a bit annoying. About the main workround I&#8217;ve found is rebuild everything. Start with the Pipeline tool- do a Build/Clean then a Build/Build. Then in the Project (in Visual Studio) do a Build/Clean then Build/Deploy which recompiles everything.</p>
<p>If the error still persists then it&#8217;s possible you have a typo; say a lowercase i instead of I in a filename. (<em>I&#8217;ve done that once</em>). Another fix though rather unsatisfactory is in the <strong>Project Properties</strong>, on the <strong>Options</strong> tab, right at the top is a checkbox <strong>Use Shared Runtime. </strong>If you untick that, deployment takes a bit longer. Instead of copying 3 MB which takes a second or so, it copies about 60 MB instead which takes a bit longer. I tried it but went back to the <strong>Clean and Deploy</strong> approach as copying was taking 10-15 seconds.</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/an-irritating-bug-with-monogame-android/">An irritating bug with MonoGame/Android</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1133</post-id>	</item>
		<item>
		<title>A test of resource loading in MonoGame</title>
		<link>https://learncgames.com/a-test-of-resource-loading-in-monogame/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-test-of-resource-loading-in-monogame</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Thu, 30 Jul 2020 23:00:55 +0000</pubDate>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[MonoGame]]></category>
		<category><![CDATA[Other stuff]]></category>
		<category><![CDATA[Timings]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=1081</guid>

					<description><![CDATA[<p>Loading resources into RAM on a smartphone can be a relatively slowish process. I&#8217;d been working on a card game and had both a set of 52 individual playing cards plus a sheet of 52 in one image. I have two Android phones so used the opportunity to test which is quicker loading 52 small [&#8230;]</p>
The post <a href="https://learncgames.com/a-test-of-resource-loading-in-monogame/">A test of resource loading in MonoGame</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignleft size-full wp-image-1083" src="https://learncgames.com/wp-content/uploads/2020/07/AC.png" alt="Ace of Clubs" width="100" height="153" /><img loading="lazy" decoding="async" class="alignleft size-full wp-image-1084" src="https://learncgames.com/wp-content/uploads/2020/07/AD.png" alt="Ace of Diamonds" width="100" height="153" /><img loading="lazy" decoding="async" class="alignleft size-full wp-image-1085" src="https://learncgames.com/wp-content/uploads/2020/07/AH.png" alt="Ace of Hearts" width="100" height="153" /><img loading="lazy" decoding="async" class="alignleft size-full wp-image-1086" src="https://learncgames.com/wp-content/uploads/2020/07/AS.png" alt="Ace of Spades" width="100" height="153" />Loading resources into RAM on a smartphone can be a relatively slowish process. I&#8217;d been working on a card game and had both a set of 52 individual playing cards plus a sheet of 52 in one image. I have two Android phones so used the opportunity to test which is quicker loading 52 small images or one larger image. MonoGame &#8216;s Draw routines can copy from part of an image; you just specify the source.</p>
<p>In this case I was comparing loading 52 images, each 100 x 153 pixels (the four aces shown are the same images) or one image that is 1500 x 633. On the face of it, loading one image should be faster- there&#8217;s a certain overhead with loading each image so you get that x 52. But larger images can be problematic especially on devices like smartphones with less smaller amounts of RAM than desktops.</p>
<p>The two smartphones are both older, one is a BLU STUDIO ONE; the other a Chinese beast which shows up in Visual Studio as an Alps X27 Plus. It was bought on Ebay and claims to have 6 GB of RAm and 128 GB storage. In practice, when I tested the storage, it ran out after 12 GB! The phone only cost me £29 so I cn&#8217;t really complain&#8230;Although it claims to be Android 9.1 in the Developer information in Settings, it like the BLU seem to be running Android Lollipop. (5,1 &#8211; level 22) when plugged into my PC/Visual Studio.</p>
<p>I first ran the load code on the 52 images in Debug mode. Possibly not the best way to test code.</p>
<pre><code class="language-csharp" data-line="">        private string LoadCards()

        {
            Stopwatch stopWatch = new Stopwatch();
            const string suits = &quot;HCDS&quot;;
            const string ranks = &quot;A23456789TJQK&quot;;
            stopWatch.Start();
            int i = 0;
            foreach (char c in suits)
            {
                int j = 0;
                foreach (char r in ranks)
                {
                    string s = @&quot;Cards\&quot;+r + c;
                    cards[i, j++] = Content.Load(s);
                }
                i++;
            }
            stopWatch.Stop();
            TimeSpan ts = stopWatch.Elapsed;

            string elapsedTime = String.Format(&quot;{0:00}:{1:00}:{2:00}.{3:00}&quot;,
                ts.Hours, ts.Minutes, ts.Seconds,
                ts.Milliseconds / 10);
            return elapsedTime;
        }</code></pre>
<p>That is the C# code to load the 52 images. The Alps which is a newer phone took 0.28 seconds to load them. The older BLU took 0.18. Neither are great times. To load the single image I commented the code out between the two stopWatch calls (Start() and Stop()) and then added this one line.</p>
<pre> allcards = Content.Load&lt;Texture2D&gt;("allcards");</pre>
<p>The single image took 0.10 seconds on the Alps and 0.06 seconds on the BLU, both roughly three times faster loading one big image than loading all 52 images.  Information like this is useful and I&#8217;ll now create my own tools for building sprite sheets of multiple images.</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/a-test-of-resource-loading-in-monogame/">A test of resource loading in MonoGame</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1081</post-id>	</item>
	</channel>
</rss>
