<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Blending issues </title>
		<link>http://www.allegro.cc/forums/view/608175</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 25 Aug 2011 23:16:38 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/al_set_blender"><span class="a">al_set_blender</span></a><span class="k2">(</span>ALLEGRO_ONE, ALLEGRO_ZERO, <a href="http://www.allegro.cc/manual/al_map_rgba"><span class="a">al_map_rgba</span></a><span class="k2">(</span><span class="n">255</span>, <span class="n">255</span>, <span class="n">255</span>, <span class="n">255</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

I cant seem to get this to work... if I want to draw transparent text shouldn&#39;t I just change the last 255 value ? Anyway this line won&#39;t work.... can&#39;t pass ALLEGRO color as int... searched the manual, found another syntax for that last parameter but it made the text not show up...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (alex Ioan)</author>
		<pubDate>Thu, 25 Aug 2011 02:46:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The other parameter is the first not the last, and it&#39;s the blend mode. You want ALLEGRO_ADD there. To get transparency you change the last parameter to the alpha value then multiply the color components by it. It makes the most sense with floats:</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/al_set_blender"><span class="a">al_set_blender</span></a><span class="k2">(</span>ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA,<a href="http://www.allegro.cc/manual/al_map_rgba_f"><span class="a">al_map_rgba_f</span></a><span class="k2">(</span><span class="n">1</span>.<span class="n">0</span><span class="k3">*</span><span class="n">0</span>.<span class="n">75</span>, <span class="n">1</span>.<span class="n">0</span><span class="k3">*</span><span class="n">0</span>.<span class="n">75</span>, <span class="n">1</span>.<span class="n">0</span><span class="k3">*</span><span class="n">0</span>.<span class="n">75</span>, <span class="n">0</span>.<span class="n">75</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Thu, 25 Aug 2011 04:35:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Error	1	error C2660: &#39;al_set_blender&#39; : function does not take 4 arguments
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (alex Ioan)</author>
		<pubDate>Thu, 25 Aug 2011 11:56:23 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Look at the code in your post, al_set_blender is a link. Click it and read the correct way to use al_set_blender.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Slartibartfast)</author>
		<pubDate>Thu, 25 Aug 2011 12:50:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>sorry, read that numerous times... but still can&#39;t figure out how it works <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />)<br />Tried examples code and other codes I found @ this forum, still does not work. </p><p>tried al_draw_text(font, al_map_rgba_f(0.25, 0.25, 0.25, 0.25), 100, 100,ALLEGRO_ALIGN_LEFT,&quot;TEXT&quot;);</p><p>this works at least...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (alex Ioan)</author>
		<pubDate>Thu, 25 Aug 2011 13:50:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m not sure, but I think Trent&#39;s post was supposed to have an OR &#39;|&#39; in place of one of the commas, which would be 3 parameters.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Thu, 25 Aug 2011 13:52:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes, that is the correct way.<br />al_set_blender sets the blending mode. The default is pre-multiplied alpha which means that the color al_map_rgba_f(0.25, 0.25, 0.25, 0.25) is actually full white that has the alpha turned down to 25%. If you wanted non pre-multiplied alpha you can also see how to do that in the al_set_blender page, and in that case you would get a dark grey with 25% alpha for these same values.</p><p>Once the blending mode is correct, you want to draw your text, which you can indeed do with al_draw_text, and if you want the text to have a certain color you&#39;d put in the correct values for the color as per your blending mode.<br />If you use the same color with any of the text drawing functions (like <a href="http://alleg.sourceforge.net/a5docs/refman/font.html#al_draw_textf">al_draw_textf</a> you will get the same result.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Slartibartfast)</author>
		<pubDate>Thu, 25 Aug 2011 14:16:40 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>so for text just use 
</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/al_draw_text"><span class="a">al_draw_text</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/font"><span class="a">font</span></a>, <a href="http://www.allegro.cc/manual/al_map_rgba_f"><span class="a">al_map_rgba_f</span></a><span class="k2">(</span><span class="n">0</span>.<span class="n">25</span>, <span class="n">0</span>.<span class="n">25</span>, <span class="n">0</span>.<span class="n">25</span>, <span class="n">0</span>.<span class="n">25</span><span class="k2">)</span>, <span class="n">100</span>, <span class="n">100</span>,ALLEGRO_ALIGN_LEFT,<span class="s">"TEXT"</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
what would be the difference between this and using a blender ?<br />and HOW the hell would that code look like since I still can&#39;t get it to work <img src="http://www.allegro.cc/forums/smileys/cheesy.gif" alt=";D" border="0" /> </p><p>PS: drawing the text with that color works well only for white.... trying to get other pure color transparent is kinda hard... </p><p>Isn&#39;t there a way to only make ANY colored text an amount of % transparent ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (alex Ioan)</author>
		<pubDate>Thu, 25 Aug 2011 14:36:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Oops, I&#39;m thinking a year ago. The correct format is:</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/al_set_blender"><span class="a">al_set_blender</span></a><span class="k2">(</span>ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Thu, 25 Aug 2011 19:20:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE);</p><p>this makes images and text sorta transparent to each other... I mean when I crossover 2 bitmaps Its like they are both a bit transparent. Still that doesn&#39;t help me get faded text on black background <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (alex Ioan)</author>
		<pubDate>Thu, 25 Aug 2011 21:08:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>To fade text, adjust the alpha in the al_draw_text command. Like you have above... not sure I understand what you want though. To just draw it transparent, use 0.x for all 4 colour parameters, to make it gradually fade, adjust the values from 1.0 to 0.0 gradually over time.</p><p>EDIT: And you want ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA not ONE, ONE.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Trent Gamblin)</author>
		<pubDate>Thu, 25 Aug 2011 21:24:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>yea I got it now, it was ok in the first place</p><p>But anyway <br />al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_ONE);<br />works well... I mean it makes everything transparent to each-other <br />al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA); makes everything opaque
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (alex Ioan)</author>
		<pubDate>Thu, 25 Aug 2011 23:16:38 +0000</pubDate>
	</item>
</rss>
