<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Transparency (blitting)...</title>
		<link>http://www.allegro.cc/forums/view/577264</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 05 Apr 2006 22:42:58 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Is there a way to draw a sprite or primitive so that it is transparent on-the-fly? Usually I would just create a bitmap and blit it with a trans_blender. But is there a way to call something like rectfill and have it draw to an existing bitmap with a set opacity level? </p><p>I believe this is possible through draw modes but am not sure.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ngiacomelli)</author>
		<pubDate>Wed, 05 Apr 2006 22:00:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You could use <a href="http://sourceforge.net/projects/fblend/">FBLend</a>, it&#39;s fast.</p><p>EDIT:</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">void</span>   fblend_rect_trans <span class="k2">(</span><a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a> <span class="k3">*</span>dst, <span class="k1">int</span> x, <span class="k1">int</span> y, <span class="k1">int</span> w, <span class="k1">int</span> h, <span class="k1">int</span> color, <span class="k1">int</span> fact<span class="k2">)</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (hazul)</author>
		<pubDate>Wed, 05 Apr 2006 22:06:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s a nice suggestion, but I could use OpenGL or OpenLayer or a number of other alternatives but I&#39;m sticking with vanilla Allegro on this one!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ngiacomelli)</author>
		<pubDate>Wed, 05 Apr 2006 22:33:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It is possible.</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/drawing_mode" target="_blank"><span class="a">drawing_mode</span></a><span class="k2">(</span>DRAW_MODE_TRANS, NULL, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/set_trans_blender" target="_blank"><span class="a">set_trans_blender</span></a><span class="k2">(</span><span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="n">100</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

After that, every primitive will be drawn with translucency.</p><p>edit:<br />Use solid_mode() or drawing_mode(DRAW_MODE_SOLID, NULL, 0, 0) to revert back to normal drawing.</p><p>edit:<br />Oh, and I&#39;ve been meaning to ask. There&#39;s a shortcut function for solid mode and xor mode, but why not for trans mode?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Jonny Cook)</author>
		<pubDate>Wed, 05 Apr 2006 22:41:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/drawing_mode" target="_blank"><span class="a">drawing_mode</span></a><span class="k2">(</span>DRAW_MODE_TRANS, <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Fladimir da Gorf)</author>
		<pubDate>Wed, 05 Apr 2006 22:42:58 +0000</pubDate>
	</item>
</rss>
