<?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>Nick Zalabak - techwhizbang &#187; canvas</title>
	<atom:link href="http://techwhizbang.com/tag/canvas/feed/" rel="self" type="application/rss+xml" />
	<link>http://techwhizbang.com</link>
	<description>my work, life, and ideas</description>
	<lastBuildDate>Wed, 25 Jan 2012 05:47:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Getting Started With Processing.js Tutorial</title>
		<link>http://techwhizbang.com/2010/03/processingjs-tutorial/</link>
		<comments>http://techwhizbang.com/2010/03/processingjs-tutorial/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 19:56:04 +0000</pubDate>
		<dc:creator>techwhizbang</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[data visualization]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[processing.js]]></category>

		<guid isPermaLink="false">http://techwhizbang.com/?p=99</guid>
		<description><![CDATA[This past week I&#8217;ve had the opportunity to really dig in and give processing.js a work out. For those not familiar with the technology, processing.js is a JavaScript library based on the Java based processing library available for download at http://dev.processing.org/. Processing.js uses the HTML5 Canvas element to draw shapes and designs while using a [...]]]></description>
			<content:encoded><![CDATA[<p><img class=" alignnone" title="Processing.js image" src="http://processingjs.org/content/download/processingjs.gif" alt="Processing.js" width="48" height="48" />This past week I&#8217;ve had the opportunity to really dig in and give <a href="http://processingjs.org" target="_blank">processing.js</a> a work out. For those not familiar with the technology, processing.js is a JavaScript library based on the Java based processing library available for download at <a href="http://dev.processing.org/" target="_blank">http://dev.processing.org/</a>. Processing.js uses the HTML5 Canvas element to draw shapes and designs while using a similar API to the one defined by the Java library.</p>
<p>I found the barrier to entry was unnecessarily frustrating due to the lack of a _good_ beginners tutorial calling out common pitfalls. But don&#8217;t let this sway you, because once you move past this, it is really fun.</p>
<p>Here are the things they don&#8217;t tell you about getting started.</p>
<ul></ul>
<ol>
<li>You should download the <a href="http://processingjs.org/content/download/processing-js-0.6-examples.zip" target="_blank">basic examples zip</a> from the their site.</li>
<li>You&#8217;ll want to grab the processing.init.js and the processing.js from the zip or tarball to include on your page.</li>
<li>As you begin coding you must tag any processing.js script on your page with

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span>“application<span style="color: #339933;">/</span>processing”<span style="color: #339933;">&gt;</span>
<span style="color: #006600; font-style: italic;">//your script here</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

</li>
<li>You must have a corresponding

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>canvas width<span style="color: #339933;">=</span>“200px” height<span style="color: #339933;">=</span>“200px”<span style="color: #339933;">&gt;&lt;/</span>canvas<span style="color: #339933;">&gt;</span></pre></div></div>

<p>         tag after your script in order for it to render the drawing. Make height and width whatever size you&#8217;d like.</li>
<li>Another note is that you can have multiple canvases on your page, you&#8217;re not limited to one.</li>
<li>The processing.init.js looks for

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span>“application<span style="color: #339933;">/</span>processing”<span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>            tag on your page and performs the processing.js initialization, if you don&#8217;t have this included on your page nothing will be drawn.</li>
<li>An alternative to using the processing.init.js and &lt;script type=&#8221;application/processing&#8221;&gt;&lt;/script&gt; is to use the datasrc attribute on the canvas tag.

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>canvas datasrc<span style="color: #339933;">=</span>”your_processing_script.<span style="color: #660066;">js</span>”<span style="color: #339933;">&gt;&lt;/</span>canvas<span style="color: #339933;">&gt;</span></pre></div></div>

</li>
</ol>
<p>These are just some of the things I ran into and I hope this helps anyone trying to get started with processsing.js. Next time I will post something using the processing.js library.</p>
<ul></ul>
]]></content:encoded>
			<wfw:commentRss>http://techwhizbang.com/2010/03/processingjs-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.856 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-06 14:41:15 -->

