<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The efnx code blog. &#187; background</title>
	<atom:link href="http://efnx.com/tag/background/feed/" rel="self" type="application/rss+xml" />
	<link>http://efnx.com</link>
	<description>code. blog.</description>
	<lastBuildDate>Tue, 15 May 2012 17:46:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Simple Tiling Sprite Class in AS3</title>
		<link>http://efnx.com/conveniently-simple-tiling-sprite/</link>
		<comments>http://efnx.com/conveniently-simple-tiling-sprite/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 01:33:11 +0000</pubDate>
		<dc:creator>Schell</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[simple tile]]></category>
		<category><![CDATA[tile]]></category>
		<category><![CDATA[tiling background]]></category>

		<guid isPermaLink="false">http://blog.efnx.com/?p=25</guid>
		<description><![CDATA[Also known as &#8220;Developing a Pure AS3 GUI &#8211; Part 1.5 (tile) Jump to Source After writing last night&#8217;s class, scalingBars, I decided to make it a little easier on myself to tile bitmaps across the screen. I wrote a simple class that when given either a BitmapData object or a path to an image [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Also known as &#8220;Developing a Pure AS3 GUI &#8211; Part 1.5 (tile)</strong><br />
<a href="#source">Jump to Source</a><br />
After writing last night&#8217;s class, <a href="http://blog.efnx.com/?p=20">scalingBars</a>, I decided to make it a little easier on myself to tile bitmaps across the screen. I wrote a simple class that when given either a BitmapData object or a path to an image file (as a String), class will tile the image x pixels in width and y pixels in height. This is great for backgrounds or window bars or box sides, etc. Here&#8217;s the usage:</p>
<div class="codecolorer-container actionscript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">var</span> bar:tile = <span style="color: #000000; font-weight: bold;">new</span> tile<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;pathToImageOrBitmapDataObject&quot;</span>, <span style="color: #cc66cc;">100</span>, <span style="color: #cc66cc;">150</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp;addChild<span style="color: #66cc66;">&#40;</span>bar<span style="color: #66cc66;">&#41;</span>;</div></div>
<p>The previous code will grab an image from &#8220;pathToImage&#8221; [either relative or absolute, but remember security!] and then tile it 100 pixels wide by 150 pixels tall. Simple. Now let&#8217;s say you wanted to resize it:</p>
<div class="codecolorer-container actionscript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">bar.<span style="color: #006600;">resize</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span>, <span style="color: #cc66cc;">40</span><span style="color: #66cc66;">&#41;</span>;</div></div>
<p>That code will re-tile the image to 20 pixels by 40 pixels. Next on my list of upgrades is to allow reloading of different images. Shouldn&#8217;t be too hard.<br />
<strong>Example</strong><br />
<iframe width="100%" height="400" src="http://blog.efnx.com/wp-content/uploads/2007/11/tile.html"></iframe><br />
<strong><a name="#source">Source</a></strong><br />
<a href='http://blog.efnx.com/wp-content/uploads/2007/11/blogefnxcom-tile.zip' title='tile Class Source Code'>tile Class Source Code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://efnx.com/conveniently-simple-tiling-sprite/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
	</channel>
</rss>

