<?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>Chris Herring &#187; pixels</title>
	<atom:link href="http://blog.chrisherring.co.uk/tag/pixels/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.chrisherring.co.uk</link>
	<description>Interaction, development and everything in between...</description>
	<lastBuildDate>Sun, 16 May 2010 16:30:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The bit between pixels</title>
		<link>http://blog.chrisherring.co.uk/2009/10/19/the-bit-between-pixels/</link>
		<comments>http://blog.chrisherring.co.uk/2009/10/19/the-bit-between-pixels/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 21:53:31 +0000</pubDate>
		<dc:creator>blog.chrisherring.co.uk</dc:creator>
				<category><![CDATA[Snippets]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[pixels]]></category>

		<guid isPermaLink="false">http://blog.chrisherring.co.uk/?p=738</guid>
		<description><![CDATA[
A little Actionscript 3.0 function to help to find those DisplayObjects in Flash which are placed on half pixels and then snap them back into place. Although you can just leave them floating on half pixels if you want!


private function displayListSnapper(container:DisplayObjectContainer, round:Boolean, debug:Boolean, indent:String = ""):void
{
  var child:DisplayObject;
  for (var i:uint=0; i < [...]]]></description>
			<content:encoded><![CDATA[<p>
A little Actionscript 3.0 function to help to find those DisplayObjects in Flash which are placed on half pixels and then snap them back into place. Although you can just leave them floating on half pixels if you want!
</p>
<p><code><br />
private function displayListSnapper(container:DisplayObjectContainer, round:Boolean, debug:Boolean, indent:String = ""):void<br />
{<br />
  var child:DisplayObject;<br />
  for (var i:uint=0; i < container.numChildren; i++)<br />
  {<br />
    child = container.getChildAt(i);</p>
<p>	if(round == true)<br />
	{<br />
     child.x = Math.round(child.x);<br />
     child.y = Math.round(child.y);<br />
	}</p>
<p>	if(debug == true)<br />
	{<br />
	 trace(indent + "DisplayObject: " +child + ":: Name: " +  child.name + " :: x:" + child.x + " :: y:" + child.y);<br />
	}</p>
<p>	if (container.getChildAt(i) is DisplayObjectContainer)<br />
	{<br />
	 roundDisplayList(DisplayObjectContainer(child), round, debug, indent + "^^^")<br />
	}<br />
  }<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chrisherring.co.uk/2009/10/19/the-bit-between-pixels/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
