<?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>Paul Brunt &#187; javascript</title>
	<atom:link href="http://www.paulbrunt.co.uk/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.paulbrunt.co.uk</link>
	<description>faster, better; faster, better!</description>
	<lastBuildDate>Sun, 24 Jan 2010 13:57:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SVG Flip</title>
		<link>http://www.paulbrunt.co.uk/2009/11/07/svg-flip-blog-post/</link>
		<comments>http://www.paulbrunt.co.uk/2009/11/07/svg-flip-blog-post/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 09:01:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[Programing]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[svg]]></category>

		<guid isPermaLink="false">http://www.paulbrunt.co.uk/?p=255</guid>
		<description><![CDATA[The latest project is finally finished, I say finished but as always there is stuff that could be done to improve things. I decided to see what SVG was capable of so I set about creating a page turning document view such as:
http://ecom.armourhome.co.uk/brochures/armour_hotel/
You can view the final SVG version here:
http://www.paulbrunt.co.uk/svgflip/
Big thanks for the benderart peeps [...]]]></description>
			<content:encoded><![CDATA[<p>The latest project is finally finished, I say finished but as always there is stuff that could be done to improve things. I decided to see what SVG was capable of so I set about creating a page turning document view such as:</p>
<p><a href="http://ecom.armourhome.co.uk/brochures/armour_hotel/">http://ecom.armourhome.co.uk/brochures/armour_hotel/</a></p>
<p>You can view the final SVG version here:</p>
<p><a href="http://www.paulbrunt.co.uk/svgflip/">http://www.paulbrunt.co.uk/svgflip/</a><span id="more-255"></span></p>
<p>Big thanks for the benderart peeps for letting me use blenderart magazine in this demo.</p>
<p>You can download all the code for this demo here:</p>
<p><a href="http://www.paulbrunt.co.uk/svgflip/svgflip.zip">http://www.paulbrunt.co.uk/svgflip/svgflip.zip</a></p>
<p>If you want to use and change the pages simply edit the config.xml file.</p>
<p>For anyone wanting to learn from the code, I must sincerely apologise, I wasn&#8217;t even sure where I was going to end up in this project so the code turned into a complete mess, so lets call it a &#8220;proof of concept&#8221;.The transforms work but even I can&#8217;t figure out what I was thinking when I wrote them. For<span> </span>that reason, I&#8217;m not worried about the copyright on this code, use it, abuse it, do whatever you want, I give you my permission; since I don&#8217;t think it&#8217;s maintainable enough to warrant an open source license. My only hope is that it inspires someone to do something better. If you really want to see how the effect is achieved there is an excellent tutorial at:<span> </span><a style="font-family: arial,sans-serif; color: #664d9f;" href="http://oreilly.com/javascript/archive/flashhacks.html" target="_blank">http://oreilly.com/javascript/archive/flashhacks.html</a>. It&#8217;s written from the perspective of flash but the same principles apply to SVG.</p>
<p><span style="background-color: #ffffff;">Comments and observations:</span></p>
<ul>
<li>I was originally going to be using SVG masks. Thankfully, I didn&#8217;t as the performance was far slower than clipping paths and in the end it wouldn&#8217;t have been usable, but I may not have noticed until too late.</li>
<li>For some reason chrome was rendering the masks offset. I have a feelling it&#8217;s applying the transforms in a different order from firefox and opera, so the mask was being applied at a different point.</li>
<li>Although the performance seems the best in chrome/webkit, I&#8217;m putting this down mainly to the fact that chrome seems to render clipping paths with no anti-aliasing by default. Although, there are &#8220;render&#8221; options within the SVG spec none of the browsers seemed to render any differently no matter what I set. It was also a little unclear as to where you would apply said render options when it came to clipping paths and masks.</li>
<li>Firefox really needs to have a decent<span> </span>font<span> </span>implementation,<span> </span>webkit&#8217;s<span> </span>was also lacking but seems much further advanced. Opera was nearly perfect with their SVG font implementation. In the end I ended up converting the fonts to paths just to make it display consistently across the browsers.</li>
<li>Chrome doesn&#8217;t seem to be too great with filters at the moment,and importantly it&#8217;s missing Gaussian blur. It would have been really useful and allowed much more eye candy had I been able to use it.</li>
<li>From a performance point of view I would say SVG would benefit greatly from having a cache as bitmap option to indicate when the browser doesn&#8217;t need to re-render everything from scratch when animating through the DOM. As it was I ended up using proxy images during most of the animation just to get the speed to a decent level.</li>
<li>It would have been far better if SVG and Canvas were more tightly integrated, there where many points during the development where using a bitmapped version of the SVG would have been far more preferable, unfortunately it seems that as yet you can&#8217;t just draw SVG onto the canvas like other image formats.</li>
</ul>
<p>Conclusion, SVG is getting there very slowly. Hopefully, all the recent press around<span> </span>SVGWeb<span> </span>and the recent SVG Open will spur people on to use it more and we can get out of the chicken and egg situation we seem to be in at the moment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulbrunt.co.uk/2009/11/07/svg-flip-blog-post/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Berts Breakdown</title>
		<link>http://www.paulbrunt.co.uk/2009/09/20/berts-breakdown/</link>
		<comments>http://www.paulbrunt.co.uk/2009/09/20/berts-breakdown/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 11:00:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blender]]></category>
		<category><![CDATA[Features]]></category>
		<category><![CDATA[Programing]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://127.0.0.1/wordpress/?p=146</guid>
		<description><![CDATA[

As a learning exercise and an attempt to push the latest browsers I decided to create a platform game using the new HTML5 canvas element. Although I did encounter a few minor issues, things generally went quite smoothly and surprisingly quickly.  The whole game, graphics and all, only took about 100 hours. 
&#62;&#62;Play Berts Breakdown [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">
<p><a style="float:right;display:block;" href="http://www.chromeexperiments.com/detail/berts-breakdown/"><img class="size-full wp-image-249" title="badge-white_white" src="http://www.paulbrunt.co.uk/wp-content/uploads/2009/09/badge-white_white.png" alt="See my Experiment on ChromeExperiments.com" width="160" height="92" /></a></p>
<p>As a learning exercise and an attempt to push the latest browsers I decided to create a platform game using the new HTML5 canvas element. Although I did encounter a few minor issues, things generally went quite smoothly and surprisingly quickly.  The whole game, graphics and all, only took about 100 hours. <span id="more-146"></span></p>
<p style="text-align: center;"><a title="Berts Breakdown" href="http://www.paulbrunt.co.uk/bert" target="_blank">&gt;&gt;Play Berts Breakdown Now&lt;&lt;</a></p>
<p>I&#8217;m sure the game could be faster I can see glaring optimizations that could be made but to be honest it seems to run more than okay on the machines I&#8217;ve tested it on, which was a little bit of a shock. Chrome was particularly impressive and was managing an extraordinary 120fps with Firefox 3.5 coming in a not too shabby second at 85fps, admittedly that is on a quad core (though the game only used one) machine with 4 gig of ram etc. But it seemed to be just about playable on a 900MHz eee.</p>
<p>Here is an open question to anyone out there in the game dev world.  How do you make tiles effectively?  I did the majority of the graphics using blender (with a little tweaking occasionally with the gimp) and extracting tiles from the rendered maps was proving to be very time consuming when doing it manually. So, I did what any programmer would do and wrote a script that attempted to identify unique tiles within the rendered images but it was proving very difficult to automate effectively. In the end I decided to go with the automated method even though it doubled (estimate) the number of tiles required to reproduce the maps. I will have to go back and work on that script at some point; no doubt such a thing will come in useful in future.</p>
<p>I&#8217;ve not tried the game with explorer canvas yet but I&#8217;m not holding out much hope that it&#8217;ll perform at any sort of usable level though I would really like to be surprised. Unfortunately, the game isn&#8217;t working on IE without modification (what a surprise). I know IE has improved a lot but it&#8217;s still lagging so far behind the other browsers in so many ways, I&#8217;m at a complete loss as to why anyone anywhere would run it voluntarily (rant over). Anyway, I&#8217;ll see if I can get it working in IE at some point but I&#8217;m not going out my way on this one, perhaps the next game.</p>
<p style="text-align: center;"><a title="Berts Breakdown" href="../bert" target="_blank">&gt;&gt;Play Berts Breakdown Now&lt;&lt;</a></p>
<p style="text-align: left;"><strong>UPDATE: The wonderfull folks over at google have made life so much easier today; Berts breakdown will now work in ie6+ thanks to Google Chrome Frame. Get it from <a href="http://code.google.com/chrome/chromeframe/">http://code.google.com/chrome/chromeframe/</a> or simply follow the prompt when you try and play the game.</strong></p>
<p style="text-align: left;">PS, given this news I&#8217;m no longer going to bother adapting for excanvas.</p>

<div class="ngg-galleryoverview" id="ngg-gallery-5-146">


	<!-- Piclense link -->
	<div class="piclenselink">
		<a class="piclenselink" href="javascript:PicLensLite.start({feedUrl:'http://www.paulbrunt.co.uk/wp-content/plugins/nextgen-gallery/xml/media-rss.php?gid=5&amp;mode=gallery'});">
			[View with PicLens]		</a>
	</div>
	
	<!-- Thumbnails -->
		
	<div id="ngg-image-13" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.paulbrunt.co.uk/wp-content/gallery/berts-breakdown/bert1.jpg" title=" " class="thickbox" rel="berts-breakdown" >
				<img title="bert1" alt="bert1" src="http://www.paulbrunt.co.uk/wp-content/gallery/berts-breakdown/thumbs/thumbs_bert1.jpg" width="120" height="85" />
			</a>
		</div>
	</div>
	 		
	<div id="ngg-image-14" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.paulbrunt.co.uk/wp-content/gallery/berts-breakdown/bert2.jpg" title=" " class="thickbox" rel="berts-breakdown" >
				<img title="bert2" alt="bert2" src="http://www.paulbrunt.co.uk/wp-content/gallery/berts-breakdown/thumbs/thumbs_bert2.jpg" width="120" height="85" />
			</a>
		</div>
	</div>
	 		
	<div id="ngg-image-15" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.paulbrunt.co.uk/wp-content/gallery/berts-breakdown/bert3.jpg" title=" " class="thickbox" rel="berts-breakdown" >
				<img title="bert3" alt="bert3" src="http://www.paulbrunt.co.uk/wp-content/gallery/berts-breakdown/thumbs/thumbs_bert3.jpg" width="120" height="85" />
			</a>
		</div>
	</div>
	 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>


<p><del datetime="2009-09-20T12:07:47+00:00"></del></p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulbrunt.co.uk/2009/09/20/berts-breakdown/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>New Website!</title>
		<link>http://www.paulbrunt.co.uk/2009/09/20/new-website/</link>
		<comments>http://www.paulbrunt.co.uk/2009/09/20/new-website/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 08:30:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[Programing]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://192.168.0.8/wordpress/?p=215</guid>
		<description><![CDATA[So, I finally got round to learning the innards of wordpress and created this custom theme for my site. I really ended up disliking the last, which was just a heavily modified version free one, so I never really finished if off properly. Apologies, IE6 users I don&#8217;t really think it&#8217;s worth it making this [...]]]></description>
			<content:encoded><![CDATA[<p>So, I finally got round to learning the innards of wordpress and created this custom theme for my site. I really ended up disliking the last, which was just a heavily modified version free one, so I never really finished if off properly. Apologies, IE6 users I don&#8217;t really think it&#8217;s worth it making this site work 100%, and besides I don&#8217;t have a version of IE6 installed I can test this on.<span id="more-215"></span></p>
<p>I know the blinking eye in the corner is a little creepy,I just wanted some sort of animation up there and a blinking eye was the least amout of work. I do plan on periodically changing the logo animation, I was thinking maybe a UFO (inspired by google recent forray into UFO banners) next time. I&#8217;ll try and post some of the scripts as small tutorials when I have a bit more of a chance to work on them, but I&#8217;m currently working on a canvas based mini game (fingers crossed that this time the game will be fast enough to work with explorercanvas). There is still some work to do I&#8217;ve not optimised anything yet so expect a faster site in the next few weeks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulbrunt.co.uk/2009/09/20/new-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Essential AJAX Functions</title>
		<link>http://www.paulbrunt.co.uk/2008/09/17/essential-ajax-functions/</link>
		<comments>http://www.paulbrunt.co.uk/2008/09/17/essential-ajax-functions/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 14:14:52 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Programing]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.paulbrunt.co.uk/?p=97</guid>
		<description><![CDATA[Okay here are a couple of really usefull javascript functions when it come to ajax. Though having recently decoverd jquery I may use a little less now:
This one is cross browser and will retrive and xmldoc from a given url:

function loadXMLDoc(url) {
req = false;
// branch for native XMLHttpRequest object
if(window.XMLHttpRequest) {
try {
req = new XMLHttpRequest();
} catch(e) [...]]]></description>
			<content:encoded><![CDATA[<p>Okay here are a couple of really usefull javascript functions when it come to ajax. Though having recently decoverd jquery I may use a little less now:<span id="more-97"></span></p>
<p>This one is cross browser and will retrive and xmldoc from a given url:</p>
<p><code><br />
function loadXMLDoc(url) {<br />
req = false;<br />
// branch for native XMLHttpRequest object<br />
if(window.XMLHttpRequest) {<br />
try {<br />
req = new XMLHttpRequest();<br />
} catch(e) {<br />
req = false;<br />
}<br />
// branch for IE/Windows ActiveX version<br />
} else if(window.ActiveXObject) {<br />
try {<br />
req = new ActiveXObject("Msxml2.XMLHTTP");<br />
} catch(e) {<br />
try {<br />
req = new ActiveXObject("Microsoft.XMLHTTP");<br />
} catch(e) {<br />
req = false;<br />
}<br />
}<br />
}<br />
if(req) {<br />
req.open("GET", url, false);<br />
req.send("");<br />
}<br />
return req.responseXML<br />
}<br />
</code></p>
<p>This will send a doucment to a url and return a textstring responce:</p>
<p><code><br />
function sendXMLDoc(url,doc) {<br />
req = false;<br />
// branch for native XMLHttpRequest object<br />
if(window.XMLHttpRequest) {<br />
try {<br />
req = new XMLHttpRequest();<br />
} catch(e) {<br />
req = false;<br />
}<br />
// branch for IE/Windows ActiveX version<br />
} else if(window.ActiveXObject) {<br />
try {<br />
req = new ActiveXObject("Msxml2.XMLHTTP");<br />
} catch(e) {<br />
try {<br />
req = new ActiveXObject("Microsoft.XMLHTTP");<br />
} catch(e) {<br />
req = false;<br />
}<br />
}<br />
}<br />
if(req) {<br />
req.open("POST", url, false);<br />
req.send(doc);<br />
}<br />
return req.responseText<br />
}<br />
</code></p>
<p>Note: I can&#8217;t remember where these came from I don&#8217;t remember writing them.<br />
So, if you think you did and you would like me to credit or remove please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulbrunt.co.uk/2008/09/17/essential-ajax-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
