<?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>Seb Lee-Delisle &#187; cacheAsBitmap</title>
	<atom:link href="http://sebleedelisle.com/category/flash/cacheasbitmap/feed/" rel="self" type="application/rss+xml" />
	<link>http://sebleedelisle.com</link>
	<description>Actionscript Games, Physics and Papervision3D</description>
	<lastBuildDate>Sat, 31 Jul 2010 15:41:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Bitmap Parallax Techniques</title>
		<link>http://sebleedelisle.com/2006/12/bitmap-parallax-techniques/</link>
		<comments>http://sebleedelisle.com/2006/12/bitmap-parallax-techniques/#comments</comments>
		<pubDate>Wed, 20 Dec 2006 18:56:32 +0000</pubDate>
		<dc:creator>Seb Lee-Delisle</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Game programming]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[cacheAsBitmap]]></category>

		<guid isPermaLink="false">http://www.sebleedelisle.com/?p=73</guid>
		<description><![CDATA[OK so it&#8217;s go go GO on this huuuuge platform game &#8211; 9 levels and a 1st March deadline. Yes, Christmas is cancelled. So I suspect that I may go a little quiet on the blog for a bit&#8230; But&#8230; I thought you may like to know, I&#8217;ve been doing a little test on the [...]


Related posts:<ol><li><a href='http://sebleedelisle.com/3d-example-files/parallax-test-bitmap-fill-method-2/' rel='bookmark' title='Permanent Link: Parallax test &#8211; Bitmap Fill method'>Parallax test &#8211; Bitmap Fill method</a></li>
<li><a href='http://sebleedelisle.com/2006/11/a-cacheasbitmap-vs-supercacheasbitmap-demo/' rel='bookmark' title='Permanent Link: A cacheAsBitmap vs superCacheAsBitmap demo'>A cacheAsBitmap vs superCacheAsBitmap demo</a></li>
<li><a href='http://sebleedelisle.com/2006/10/new-improved-cacheasbitmap/' rel='bookmark' title='Permanent Link: New improved cacheAsBitmap!'>New improved cacheAsBitmap!</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fsebleedelisle.com%252F2006%252F12%252Fbitmap-parallax-techniques%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Bitmap%20Parallax%20Techniques%20%23%22%20%7D);"></div>
<p>OK so it&#8217;s go go GO on this huuuuge platform game &#8211; 9 levels and a 1st March deadline. Yes, Christmas is cancelled. So I suspect that I may go a little quiet on the blog for a bit&#8230;</p>
<p>But&#8230; I thought you may like to know, I&#8217;ve been doing a little test on the best way to do parallax scrolling. What I wanted to avoid is having assets that come off the edges of the screen. If you make a parallax tile that&#8217;s one screenwidth, you pretty much always have to have two copies of it on screen because the join will always have to be in the middle of the screen somewhere.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_swfcontainer_1968992494"
			class="flashmovie"
			width="450"
			height="200">
	<param name="movie" value="/uploads/swfcontainer.swf" />
	<param name="flashvars" value="swfFile=/wp-content/uploads/2006/12/parallaxdemo.swf&amp;frameSnapshot=20&amp;swfScale=100&amp;timeoutFrames=250" />
	<param name="bgcolor" value="#ffffff" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/uploads/swfcontainer.swf"
			name="fm_swfcontainer_1968992494"
			width="450"
			height="200">
		<param name="flashvars" value="swfFile=/wp-content/uploads/2006/12/parallaxdemo.swf&amp;frameSnapshot=20&amp;swfScale=100&amp;timeoutFrames=250" />
		<param name="bgcolor" value="#ffffff" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>So what I thought I&#8217;d try is convert the parallax layers into bitmaps, and then do bitmap fills for each one. The bitmap fill is the size of the screen, and the beauty of this method is that the tiles automatically repeat, because you can do that with bitmap fills.</p>
<p>So having got that working, sadly it seems that the original way is faster, assuming you cacheAsBitmap the layers. Ho hum.</p>
<p>Examples are here :</p>
<p><a href="/?page_id=72">Using bitmapFill()</a></p>
<p><a href="/?page_id=71">Using big tiles that go off the edge of the screen</a></p>
<p>The number in the top left hand corner is the number of ms per frame (average over 100 frames).</p>
<p>Now I&#8217;m going to try drawing the layers into a single bitmap instead. Wish me luck!</p>
<p><em>Artwork by Plug-in&#8217;s creative genius Dominic Minns, if you wanna see the (old) Christmas game that these assets are from : <a href="http://www.pluginmedia.net/ipaxmas">Red Nose Racer</a></em></p>



<p>Related posts:<ol><li><a href='http://sebleedelisle.com/3d-example-files/parallax-test-bitmap-fill-method-2/' rel='bookmark' title='Permanent Link: Parallax test &#8211; Bitmap Fill method'>Parallax test &#8211; Bitmap Fill method</a></li>
<li><a href='http://sebleedelisle.com/2006/11/a-cacheasbitmap-vs-supercacheasbitmap-demo/' rel='bookmark' title='Permanent Link: A cacheAsBitmap vs superCacheAsBitmap demo'>A cacheAsBitmap vs superCacheAsBitmap demo</a></li>
<li><a href='http://sebleedelisle.com/2006/10/new-improved-cacheasbitmap/' rel='bookmark' title='Permanent Link: New improved cacheAsBitmap!'>New improved cacheAsBitmap!</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://sebleedelisle.com/2006/12/bitmap-parallax-techniques/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>A cacheAsBitmap vs superCacheAsBitmap demo</title>
		<link>http://sebleedelisle.com/2006/11/a-cacheasbitmap-vs-supercacheasbitmap-demo/</link>
		<comments>http://sebleedelisle.com/2006/11/a-cacheasbitmap-vs-supercacheasbitmap-demo/#comments</comments>
		<pubDate>Sat, 04 Nov 2006 11:47:51 +0000</pubDate>
		<dc:creator>Seb Lee-Delisle</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Physics]]></category>
		<category><![CDATA[cacheAsBitmap]]></category>

		<guid isPermaLink="false">http://www.sebleedelisle.com/?p=35</guid>
		<description><![CDATA[Here&#8217;s another demo of the work we&#8217;ve been doing on a custom cacheAsBitmap utility, we&#8217;re calling superCacheAsBitmap. The circle in the middle of the demo is made up of 1000 transparent lines, so you shouldn&#8217;t be surprised that it&#8217;s very slow to render using traditional methods! Click Move Clip to get things started, and you&#8217;ll [...]


Related posts:<ol><li><a href='http://sebleedelisle.com/2006/10/new-improved-cacheasbitmap/' rel='bookmark' title='Permanent Link: New improved cacheAsBitmap!'>New improved cacheAsBitmap!</a></li>
<li><a href='http://sebleedelisle.com/2006/12/cool-flash-3d-on-the-beach/' rel='bookmark' title='Permanent Link: Cool Flash 3D (on the beach)'>Cool Flash 3D (on the beach)</a></li>
<li><a href='http://sebleedelisle.com/2006/12/bitmap-parallax-techniques/' rel='bookmark' title='Permanent Link: Bitmap Parallax Techniques'>Bitmap Parallax Techniques</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fsebleedelisle.com%252F2006%252F11%252Fa-cacheasbitmap-vs-supercacheasbitmap-demo%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22A%20cacheAsBitmap%20vs%20superCacheAsBitmap%20demo%20%23%22%20%7D);"></div>
<p>Here&#8217;s another demo of the work we&#8217;ve been doing on a custom cacheAsBitmap utility, we&#8217;re calling superCacheAsBitmap.</p>
<p>The circle in the middle of the demo is made up of 1000 transparent lines, so you shouldn&#8217;t be surprised that it&#8217;s very slow to render using traditional methods! Click <em>Move Clip</em> to get things started, and you&#8217;ll see what I mean.</p>
<p>Select the <em>cacheAsBitmap </em>option and it&#8217;s speeds up! Yay! But now hit the <em>Rotate Clip</em> button, and we&#8217;re back down to a grind. This is because the MovieClip&#8217;s appearance changes and the Flash Player has to re-render the clip every frame.</p>
<p>So now select the <em>superCacheAsBitmap</em>, and we&#8217;re back up to speed! We&#8217;re creating a bitmap and rotating that instead. You&#8217;ll see though that the quality isn&#8217;t very good, but often when we&#8217;re moving things at speed this isn&#8217;t a problem. But if it is, just select <em>superCacheAsBitmap with smoothing</em> and this time the player rotates the bitmap with interpolation. It&#8217;s slower but not as slow as without caching.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_bitmapcachertest3_1856367688"
			class="flashmovie"
			width="440"
			height="300">
	<param name="movie" value="/wp-content/uploads/2006/11/bitmapcachertest3.swf" />
	<param name="scale" value="noborder" />
	<param name="bgcolor" value="#C7DCEB" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/wp-content/uploads/2006/11/bitmapcachertest3.swf"
			name="fm_bitmapcachertest3_1856367688"
			width="440"
			height="300">
		<param name="scale" value="noborder" />
		<param name="bgcolor" value="#C7DCEB" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>Code coming as soon as I package it up!</p>



<p>Related posts:<ol><li><a href='http://sebleedelisle.com/2006/10/new-improved-cacheasbitmap/' rel='bookmark' title='Permanent Link: New improved cacheAsBitmap!'>New improved cacheAsBitmap!</a></li>
<li><a href='http://sebleedelisle.com/2006/12/cool-flash-3d-on-the-beach/' rel='bookmark' title='Permanent Link: Cool Flash 3D (on the beach)'>Cool Flash 3D (on the beach)</a></li>
<li><a href='http://sebleedelisle.com/2006/12/bitmap-parallax-techniques/' rel='bookmark' title='Permanent Link: Bitmap Parallax Techniques'>Bitmap Parallax Techniques</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://sebleedelisle.com/2006/11/a-cacheasbitmap-vs-supercacheasbitmap-demo/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>New improved cacheAsBitmap!</title>
		<link>http://sebleedelisle.com/2006/10/new-improved-cacheasbitmap/</link>
		<comments>http://sebleedelisle.com/2006/10/new-improved-cacheasbitmap/#comments</comments>
		<pubDate>Thu, 26 Oct 2006 22:32:38 +0000</pubDate>
		<dc:creator>Seb Lee-Delisle</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Physics]]></category>
		<category><![CDATA[cacheAsBitmap]]></category>

		<guid isPermaLink="false">http://www.sebleedelisle.com/?p=32</guid>
		<description><![CDATA[I&#8217;ve been working on a smart function that can convert a MovieClip into a bitmap so that it renders faster. &#8220;What&#8217;s wrong with the cacheAsBitmap property?&#8221; I hear you cry. Well much as it&#8217;s an amazing way to optimize the speed of moving clips, it can sometimes actually slow down render time! It&#8217;s fine as [...]


Related posts:<ol><li><a href='http://sebleedelisle.com/2006/11/a-cacheasbitmap-vs-supercacheasbitmap-demo/' rel='bookmark' title='Permanent Link: A cacheAsBitmap vs superCacheAsBitmap demo'>A cacheAsBitmap vs superCacheAsBitmap demo</a></li>
<li><a href='http://sebleedelisle.com/2006/10/moviecliptransformmatrix-experiments/' rel='bookmark' title='Permanent Link: MovieClip.transform.matrix experiments&#8230;'>MovieClip.transform.matrix experiments&#8230;</a></li>
<li><a href='http://sebleedelisle.com/2006/12/bitmap-parallax-techniques/' rel='bookmark' title='Permanent Link: Bitmap Parallax Techniques'>Bitmap Parallax Techniques</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fsebleedelisle.com%252F2006%252F10%252Fnew-improved-cacheasbitmap%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22New%20improved%20cacheAsBitmap%21%20%23%22%20%7D);"></div>
<p>I&#8217;ve been working on a smart function that can convert a MovieClip into a bitmap so that it renders faster. &#8220;What&#8217;s wrong with the cacheAsBitmap property?&#8221; I hear you cry. Well much as it&#8217;s an amazing way to optimize the speed of moving clips, it can sometimes actually slow down render time!</p>
<p>It&#8217;s fine as long as you don&#8217;t resize or rotate your MovieClip. But as soon as you change the clip, the FlashPlayer has to re-create the bitmap cache.</p>
<p>So what I&#8217;ve done is make a bitmap and rotate and scale that instead. It&#8217;s not quite as good quality as when you do it with Vector graphics, but it&#8217;s so much faster it doesn&#8217;t matter.</p>
<p>And here&#8217;s an example:</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_bitmapcacheparticletest5_1691854947"
			class="flashmovie"
			width="445"
			height="350">
	<param name="movie" value="/wp-content/uploads/2006/10/bitmapcacheparticletest5.swf" />
	<param name="scale" value="noborder" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/wp-content/uploads/2006/10/bitmapcacheparticletest5.swf"
			name="fm_bitmapcacheparticletest5_1691854947"
			width="445"
			height="350">
		<param name="scale" value="noborder" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>And yes it is AS2! <img src='http://sebleedelisle.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>So I spent ages working on this code (matrix hell that you don&#8217;t want to know about), and I have a horrible feeling someone else beat me to it, so if anyone&#8217;s seen anything like this before let me know!</p>
<p>And I&#8217;ll be releasing this under a creative commons licence as soon as I get a spare moment, so keep an eye out <img src='http://sebleedelisle.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>



<p>Related posts:<ol><li><a href='http://sebleedelisle.com/2006/11/a-cacheasbitmap-vs-supercacheasbitmap-demo/' rel='bookmark' title='Permanent Link: A cacheAsBitmap vs superCacheAsBitmap demo'>A cacheAsBitmap vs superCacheAsBitmap demo</a></li>
<li><a href='http://sebleedelisle.com/2006/10/moviecliptransformmatrix-experiments/' rel='bookmark' title='Permanent Link: MovieClip.transform.matrix experiments&#8230;'>MovieClip.transform.matrix experiments&#8230;</a></li>
<li><a href='http://sebleedelisle.com/2006/12/bitmap-parallax-techniques/' rel='bookmark' title='Permanent Link: Bitmap Parallax Techniques'>Bitmap Parallax Techniques</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://sebleedelisle.com/2006/10/new-improved-cacheasbitmap/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
