<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Drawing a sprite with an origin outside the screen</title>
		<link>http://www.allegro.cc/forums/view/610911</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 28 Aug 2012 19:47:10 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I was wondering what the best way to draw an image part way outside the screen is? I&#39;d like to do this in order to display only a section of the image to fill in gaps in my isometric engine. I notice when I call al_draw_bitmap with a dx/dy less than zero nothing is displayed even if part of the image should still be visible.</p><p>Example of what I am trying to achieve:</p><p><a href="http://imgur.com/hUyUk">http://imgur.com/hUyUk</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ionising)</author>
		<pubDate>Tue, 28 Aug 2012 14:30:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Can you show the code?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Elias)</author>
		<pubDate>Tue, 28 Aug 2012 14:36:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Screenshots of my test app showing the problem:</p><p><a href="http://imgur.com/9rodW">http://imgur.com/9rodW</a></p><p>I&#39;ve wrapped up Allegro into a game library, but drawing the image boils down to one call:</p><p>    al_draw_bitmap( pImage, nXPositionPx, nYPx, nFlags );
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ionising)</author>
		<pubDate>Tue, 28 Aug 2012 14:37:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I would do something like this (lets say you don&#39;t know the size of the bitmap, but it get the -150;-150 coordinate (and the bitmap is bigger then 150x150 of course)):</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number"> 1</span>
<span class="number"> 2</span><span class="k1">int</span> x <span class="k3">=</span> <span class="k3">-</span><span class="n">150</span><span class="k2">;</span>
<span class="number"> 3</span><span class="k1">int</span> y <span class="k3">=</span> <span class="k3">-</span><span class="n">150</span><span class="k2">;</span>
<span class="number"> 4</span>
<span class="number"> 5</span><a href="http://www.allegro.cc/manual/al_draw_bitmap_region"><span class="a">al_draw_bitmap_region</span></a><span class="k2">(</span>bitmap, <a href="http://www.delorie.com/djgpp/doc/libc/libc_303.html" target="_blank">fabs</a><span class="k2">(</span>x<span class="k2">)</span>, <a href="http://www.delorie.com/djgpp/doc/libc/libc_303.html" target="_blank">fabs</a><span class="k2">(</span>y<span class="k2">)</span>, <a href="http://www.allegro.cc/manual/al_get_bitmap_width"><span class="a">al_get_bitmap_width</span></a><span class="k2">(</span>bitmap<span class="k2">)</span><span class="k3">-</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_303.html" target="_blank">fabs</a><span class="k2">(</span>x<span class="k2">)</span>, <a href="http://www.allegro.cc/manual/al_get_bitmap_height"><span class="a">al_get_bitmap_height</span></a><span class="k2">(</span>bitmap<span class="k2">)</span><span class="k3">-</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_303.html" target="_blank">fabs</a><span class="k2">(</span>y<span class="k2">)</span>, <span class="n">0</span>, <span class="n">0</span>, NULL<span class="k2">)</span>
</div></div><p>
I haven&#39;t tried it, but it should work <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Malinus)</author>
		<pubDate>Tue, 28 Aug 2012 14:41:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Not exactly related, but seeing as you&#39;re playing with isometric stuff here&#39;s something you might find interesting...</p><p><a href="http://www.servo7.co.uk/iso/masking.aspx">http://www.servo7.co.uk/iso/masking.aspx</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Tue, 28 Aug 2012 17:33:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You shouldn&#39;t need to chop the image at all, it should display as you would expect. Are you sure you&#39;re not using <span class="source-code"><span class="k1">unsigned</span> <span class="k1">int</span></span> for X and Y <img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Dizzy Egg)</author>
		<pubDate>Tue, 28 Aug 2012 17:50:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>&lt;obvious&gt;Are you really calling al_draw_bitmap directly? I.e. you don&#39;t have a condition somewhere that prevents bitmaps with negative values to be drawn? Apply palm to face, if applicable.&lt;/obvious&gt;
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (weapon_S)</author>
		<pubDate>Tue, 28 Aug 2012 19:47:10 +0000</pubDate>
	</item>
</rss>
