<?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>sanchothefat.com &#187; Processing</title>
	<atom:link href="http://sanchothefat.com/tagged/processing/feed" rel="self" type="application/rss+xml" />
	<link>http://sanchothefat.com</link>
	<description>is Robert O&#039;Rourke, a front-end web developer from Liverpool</description>
	<lastBuildDate>Thu, 03 Mar 2011 17:56:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>PJSBox</title>
		<link>http://sanchothefat.com/labs/161/pjsbox</link>
		<comments>http://sanchothefat.com/labs/161/pjsbox#comments</comments>
		<pubDate>Tue, 16 Mar 2010 17:12:17 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Processing]]></category>

		<guid isPermaLink="false">http://www.sanchothefat.com/?p=161</guid>
		<description><![CDATA[Just like cats never knew they wanted cheezburgers until the arrival of the internet here&#8217;s a bookmarklet you never knew you wanted until the arrival of now. PJSBox will run any Processing code you have selected in a lightbox. Magic! PJSBox drag this link to your bookmarks toolbar&#8230; highlight a section of processing code below&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>Just like cats never knew they wanted cheezburgers until the arrival of the internet here&#8217;s a bookmarklet you never knew you wanted until the arrival of <em>now</em>. PJSBox will run any Processing code you have selected in a lightbox. Magic!</p>
<p><span id="more-161"></span></p>
<ol>
<li><a class="bookmarklet" title="PJSBox Bookmarklet" href="javascript:void((function(){var%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('src','http://www.sanchothefat.com/dev/processing/pjs-box/pjs-box.js?'+new%20Date());document.body.appendChild(e)})())">PJSBox</a> drag this link to your bookmarks toolbar&#8230;</li>
<li>highlight a section of processing code below&#8230;</li>
<li>and click the bookmarklet you just dragged to your toolbar.</li>
</ol>
<p>You can try it out on the snippets of code below. Unfortunately it will not work with code that has been run through a javascript highlighter because it makes the <abbr title="Document Object Model">DOM</abbr> a more complicated place to be. I am working on that one however and will be updating this post accordingly.</p>
<p><strong>Update:</strong> there are some bugs with this in Firefox 3.6.2 on mac but if you have any issues in other browsers/environments let me know in the comments and I will try and make the bookmarklet that bit more robust &#8211; thanks!</p>
<h2>Pie Chart:</h2>
<pre>size(200, 200);
background(100);
smooth();
noStroke();

int diameter = 150;
int[] angs = {30, 10, 45, 35, 60, 38, 75, 67};
float lastAng = 0;

for (int i = 0; i &lt; angs.length; i++){
  fill(angs[i] * 3.0);
  arc(width/2, height/2, diameter, diameter, lastAng, lastAng+radians(angs[i]));
  lastAng += radians(angs[i]);
}
</pre>
<h2>Hello Mouse:</h2>
<pre>void setup() {
  size(400, 400);
  stroke(255);
  background(192, 64, 0);
} 

void draw() {
  line(150, 25, mouseX, mouseY);
}</pre>
<h2>Width and Height:</h2>
<pre>size(200, 200);
background(127);
noStroke();
for(int i=0; i&lt;height; i+=20) {
  fill(0);
  rect(0, i, width, 10);
  fill(255);
  rect(i, 0, 10, height);
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://sanchothefat.com/labs/161/pjsbox/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>HasCanvas</title>
		<link>http://sanchothefat.com/portfolio/63/hascanvas</link>
		<comments>http://sanchothefat.com/portfolio/63/hascanvas#comments</comments>
		<pubDate>Thu, 02 Apr 2009 22:36:24 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Apps]]></category>
		<category><![CDATA[Processing]]></category>

		<guid isPermaLink="false">http://www.sanchothefat.com/blog/?p=63</guid>
		<description><![CDATA[Back in March when I started playing with Processing.js I was making page after page of sketches and it quickly got tiresome. What happened next I guess you could say was &#8220;a moment of clarity&#8221; in the words of Samuel L. I knew exactly what I wanted to make and after 2 weeks of hacking [...]]]></description>
			<content:encoded><![CDATA[<p>Back in March when I started playing with <a href="http://processingjs.org/">Processing.js</a> I was making page after page of sketches and it quickly got tiresome. What happened next I guess you could say was <em>&#8220;a moment of clarity&#8221;</em> in the words of Samuel L. I knew exactly what I wanted to make and after 2 weeks of hacking in the evenings <a href="http://hascanvas.com/">HasCanvas</a> was born.</p>
<p><span id="more-63"></span></p>
<p>The app is fairly simple. It allows you to write and share Processing.js sketches on the web without the need for the java plugin. I won&#8217;t explain it in full here &#8211; hopefully the app itself is intuitive enough. I will however offer a few tips:</p>
<ul>
<li>When you declare the size() of the sketch leaving it with no arguments will give you a full screen canvas</li>
<li>To get rid of the interface cruft when linking to a sketch you can add &#8216;/embed&#8217; to the end of your URL</li>
</ul>
<p>Thanks to all those people who have made some great feature requests, such as downloads, the resizable and lockable code window and the ability not to have your sketches appear in the browse section. I&#8217;ve had many more requests but I feel that I&#8217;ve taken HasCanvas as far as it can go in it&#8217;s current state. I want to start on a new version as a ground up re-write at some point however the nice folks behind <a href="https://bespin.mozilla.com/">Bespin</a> are working on adding a Processing.js IDE. Chances are it will be better than anything I come up with so I may take the opportunity to work on some other ideas I&#8217;ve had.</p>
<h3>Credit Where Credit is Due</h3>
<p>I built the app on the back of the hard work of others.</p>
<ul>
<li><a href="http://codeigniter.com/">Code Igniter</a> (PHP Framework)</li>
<li><a href="http://jquery.com/">jQuery</a> (Javascript Framework)</li>
<li>and of course <a href="http://processingjs.org/">Processing.js</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://sanchothefat.com/portfolio/63/hascanvas/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Scribble Thing</title>
		<link>http://sanchothefat.com/labs/13/scribble-thing</link>
		<comments>http://sanchothefat.com/labs/13/scribble-thing#comments</comments>
		<pubDate>Tue, 09 Sep 2008 23:18:37 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[Labs]]></category>
		<category><![CDATA[Processing]]></category>

		<guid isPermaLink="false">http://www.sanchothefat.com/blog/?p=13</guid>
		<description><![CDATA[This is a very simplistic drawing tool I whipped together using processing.js for a bit of fun on the way to Brighton for dConstruct. If you use Firefox you can right-click on the canvas and then click Save image as to keep a copy of the nob you&#8217;re probably going to draw.]]></description>
			<content:encoded><![CDATA[<p>This is a very simplistic drawing tool I whipped together using processing.js for a bit of fun on the way to Brighton for dConstruct. If you use Firefox you can right-click on the canvas and then click <q>Save image as</q> to keep a copy of the nob you&#8217;re probably going to draw.</p>
<p><span id="more-13"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://sanchothefat.com/labs/13/scribble-thing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

