<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Centering text.</title>
		<link>http://www.allegro.cc/forums/view/591825</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 10 Jun 2007 09:35:56 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I want to put text over a graphic, like a button or whatever, and have it centered.  Right now I&#39;m just doing it manually by adding onto the x position of the text until it looks good, which is a pain in the <span class="cuss"><span>ass</span></span>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (julian_boolean)</author>
		<pubDate>Sun, 10 Jun 2007 08:33:20 +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/textout_centre_ex" target="_blank"><span class="a">textout_centre_ex</span></a><span class="k2">(</span><span class="k2">)</span>
<a href="http://www.allegro.cc/manual/textprintf_centre_ex" target="_blank"><span class="a">textprintf_centre_ex</span></a><span class="k2">(</span><span class="k2">)</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Sun, 10 Jun 2007 08:34:13 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Omigod omigod omigod!  Are you single?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (julian_boolean)</author>
		<pubDate>Sun, 10 Jun 2007 08:38:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>A thank you would suffice <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SonShadowCat)</author>
		<pubDate>Sun, 10 Jun 2007 08:40:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Please bookmark this: <a href="http://www.allegro.cc/manual/">http://www.allegro.cc/manual/</a></p><p>Please. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>(oh, and the alternative method would be to use text_length(font,&quot;the text&quot;), and subtract half that from the x value)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Jonatan Hedborg)</author>
		<pubDate>Sun, 10 Jun 2007 08:41:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Top right corner.  The previous question was much more then a thank you <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /> but thank you.  I seen this function before but never really thought anything of it at the time because I didn&#39;t need it, then I forgot about it.</p><p>Edit:</p><p>That works..  But if I move the image the text was over then the text will remain in the same spot (because I&#39;m no longer giving it the image&#39;s current x and y position.)</p><p>Nm I think.</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/textout_centre_ex" target="_blank"><span class="a">textout_centre_ex</span></a><span class="k2">(</span>buffer, <a href="http://www.allegro.cc/manual/font" target="_blank"><span class="a">font</span></a>, caption.c_str<span class="k2">(</span><span class="k2">)</span>, xPos <span class="k3">+</span> width <span class="k3">/</span> <span class="n">2</span>, yPos, WHITE, <span class="k3">-</span><span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (julian_boolean)</author>
		<pubDate>Sun, 10 Jun 2007 08:42:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you create a button, you know the button&#39;s coordinates.  When you use <tt>textout_centre_ex</tt>, simply use the button&#39;s <tt>xPos,yPos</tt> coordinates, and the centered text should correctly align no matter where the button is located on the screen.
</p><div class="source-code snippet"><div class="inner"><pre>  <a href="http://www.allegro.cc/manual/textout_centre_ex" target="_blank"><span class="a">textout_centre_ex</span></a><span class="k2">(</span>buffer, <a href="http://www.allegro.cc/manual/font" target="_blank"><span class="a">font</span></a>, caption.c_str<span class="k2">(</span><span class="k2">)</span>, button_xPos <span class="k3">+</span> width <span class="k3">/</span> <span class="n">2</span>, button_yPos, WHITE, <span class="k3">-</span><span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (TeamTerradactyl)</author>
		<pubDate>Sun, 10 Jun 2007 09:35:56 +0000</pubDate>
	</item>
</rss>
