<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Integer blitting (text output)</title>
		<link>http://www.allegro.cc/forums/view/590841</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 04 Apr 2007 14:10:10 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>im trying to output the players health and mana for my game but according to the error in deccpp<br />invalid conversion from &#39;int&#39; to const char*<br />textout_ex( buffer, font, text, x, y, color, color);<br />does not work with integers. so how do i print integers to the screen?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GuitarGod1134)</author>
		<pubDate>Tue, 03 Apr 2007 04:07:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code snippet"><div class="inner"><pre><span class="p">#include &lt;sstream&gt;</span>
<span class="k1">using</span> <span class="k1">namespace</span> std<span class="k2">;</span>

...

stringstream ss<span class="k2">;</span>
ss <span class="k3">&lt;</span><span class="k3">&lt;</span> <span class="n">49</span><span class="k2">;</span>

<a href="http://www.allegro.cc/manual/textout_ex" target="_blank"><span class="a">textout_ex</span></a><span class="k2">(</span>buffer, <a href="http://www.allegro.cc/manual/font" target="_blank"><span class="a">font</span></a>, ss.str<span class="k2">(</span><span class="k2">)</span>.c_str<span class="k2">(</span><span class="k2">)</span>, x, y, color, color<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

Or (because I know someone else is going to post this <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />):
</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/textprintf_ex" target="_blank"><span class="a">textprintf_ex</span></a><span class="k2">(</span>buffer, <a href="http://www.allegro.cc/manual/font" target="_blank"><span class="a">font</span></a>, x, y, color, color, <span class="s">"%d"</span>, <span class="n">49</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

On a side note: Using the same color for fg and bg is probably not what you want.  I&#39;d recommend -1 for your bg parameter.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ImLeftFooted)</author>
		<pubDate>Tue, 03 Apr 2007 04:16:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I dont really understand the second function you did. I get the first 6 parameters but what are the last two? The int and ....?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GuitarGod1134)</author>
		<pubDate>Tue, 03 Apr 2007 04:24:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Read about the printf function:<br /><span class="source-code"><a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Tue, 03 Apr 2007 04:41:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Just stick with the first solution, its better anyway.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ImLeftFooted)</author>
		<pubDate>Tue, 03 Apr 2007 07:08:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You should probably read (or re-read) some tutorials on C/C++ basics as well.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Tue, 03 Apr 2007 09:32:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Just stick with the first solution, its better anyway.
</p></div></div><p>
I&#39;d go with the second method for consistency.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I dont really understand the second function you did. I get the first 6 parameters but what are the last two? The int and ....?
</p></div></div><p>
text_printf is Allegro&#39;s version of the standard printf function with extra parameters (destination bitmap, colour, position).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Archon)</author>
		<pubDate>Tue, 03 Apr 2007 10:57:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Ok I read it. thx;D
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GuitarGod1134)</author>
		<pubDate>Wed, 04 Apr 2007 14:10:10 +0000</pubDate>
	</item>
</rss>
