<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Views in allegro 5</title>
		<link>http://www.allegro.cc/forums/view/606211</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 28 Jan 2011 05:48:45 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I read the allegro 5 API but found no information about views. You have a room 3500x900 but the screen is 640x480. How can i make the screen follow the player ? And how can i divide room into views as i mentioned above
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (xantier)</author>
		<pubDate>Thu, 27 Jan 2011 23:27:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That really doesn&#39;t concern Allegro 5 since it&#39;s a bit higher level, it&#39;s up to you to do a &quot;scrolling&quot; camera.</p><p>If your background is simply going to be one big bitmap, Allegro can draw specific regions of a bitmap using <span class="source-code"><a href="http://www.allegro.cc/manual/al_draw_bitmap_region"><span class="a">al_draw_bitmap_region</span></a></span>. For any other map engines, there are plenty of tutorials around.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dario ff)</author>
		<pubDate>Thu, 27 Jan 2011 23:32:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>which functions should i use for scrolling camera ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (xantier)</author>
		<pubDate>Thu, 27 Jan 2011 23:40:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I usually keep an x and y coordinate for a camera, personally. Set it to be offset from the player&#39;s position by a certain amount at all times. Then, during the render, I offset everything I draw by that x and y. Simplest way in my opinion.</p><p>Allegro has no &quot;function&quot; for that. It&#39;s something you take care of. Or write a function for yourself. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Fri, 28 Jan 2011 01:58:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/606211/900686#target">xantier</a> said:</div><div class="quote"><p>which functions should i use for scrolling camera ?</p></div></div><p>
You can use <a href="http://www.allegro.cc/manual/5/transformations.html">transformations</a> to &quot;scroll the camera&quot; if you don&#39;t want to offset your rendering manually. For example:
</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> camera_transform<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>camera_transform<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_translate_transform"><span class="a">al_translate_transform</span></a><span class="k2">(</span><span class="k3">&amp;</span>camera_transform, <span class="k3">-</span>camera_x, <span class="k3">-</span>camera_y<span class="k2">)</span><span class="k2">;</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>camera_transform<span class="k2">)</span><span class="k2">;</span>
render_everything<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Todd Cope)</author>
		<pubDate>Fri, 28 Jan 2011 04:40:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>int camx;<br />int camy;</p><p>for each bitmap<br />drawBitmap(bitmapPosX - camx, bitmapPosY - camy, bitmap);</p><p>The idea is that if object is at 15 and camera is at 15, then by subtracting 15 it will be at 0 therefore in the center.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (jmasterx)</author>
		<pubDate>Fri, 28 Jan 2011 05:48:45 +0000</pubDate>
	</item>
</rss>
