<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Resizing the game</title>
		<link>http://www.allegro.cc/forums/view/615710</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 03 Sep 2015 21:30:43 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello, first i apologyze for my bad english.</p><p>I&#39;m new in the allegro world, so i&#39;ve some basic concepts about allegro programming.</p><p>My question is how to resize the game (images, sprites, etc..) depending of the resolution. I&#39;m making a game in fullscreen using the flag ALLEGRO_FULLSCREEN_WINDOW, and the display gets the screen resolution, but the images don&#39;t change the size.</p><p>I really apreciate any help you can give me, i hope you understand my query <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /><br />I&#39;m using allegro 5.0
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Atrevido)</author>
		<pubDate>Thu, 03 Sep 2015 04:08:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What I do is scale the entire surface using an <span class="source-code"><a href="http://www.allegro.cc/manual/ALLEGRO_TRANSFORM"><span class="a">ALLEGRO_TRANSFORM</span></a></span>.  The dead simplest way might be something like this:</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/ALLEGRO_TRANSFORM"><span class="a">ALLEGRO_TRANSFORM</span></a> t<span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_identity_transform"><span class="a">al_identity_transform</span></a><span class="k2">(</span><span class="k3">&amp;</span>t<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_scale_transform"><span class="a">al_scale_transform</span></a><span class="k2">(</span><span class="k3">&amp;</span>t, <span class="n">3</span>.<span class="n">0</span>, <span class="n">3</span>.<span class="n">0</span><span class="k2">)</span><span class="k2">;</span> <span class="c">// scaled by 3</span>
<a href="http://www.allegro.cc/manual/al_use_transform"><span class="a">al_use_transform</span></a><span class="k2">(</span><span class="k3">&amp;</span>t<span class="k2">)</span><span class="k2">;</span>

<span class="c">// now draw all your stuff, which will now be scaled</span>
draw_stuff<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

This method should work if you aren&#39;t using any other transforms in your code.</p><p>If you want the <span class="source-code">ALLEGRO_FULLSCREEN</span> to match the native dimensions of your smaller window, then your <span class="source-code">scale</span> would be <span class="source-code">screen_size_width<span class="k3">/</span>native_size_width</span>.</p><p>Most likely you will find some tweaking will be necessary.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mark Oates)</author>
		<pubDate>Thu, 03 Sep 2015 04:22:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>thanks for your quick response! I followed your advice and it worked perfectly, thank you very much for the help!! <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" /></p><p>Regards.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Atrevido)</author>
		<pubDate>Thu, 03 Sep 2015 21:30:43 +0000</pubDate>
	</item>
</rss>
