<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: HTML5 Canvas Oscillation Animation Tutorial</title>
	<atom:link href="http://www.html5canvastutorials.com/advanced/html5-canvas-oscillation-animation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.html5canvastutorials.com/advanced/html5-canvas-oscillation-animation/</link>
	<description>HTML5 Canvas tutorials, articles, labs, apps, and games</description>
	<lastBuildDate>Thu, 28 Mar 2013 01:25:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Anil</title>
		<link>http://www.html5canvastutorials.com/advanced/html5-canvas-oscillation-animation/#comment-4505</link>
		<dc:creator>Anil</dc:creator>
		<pubDate>Thu, 22 Mar 2012 13:49:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.html5canvastutorials.com/?p=988#comment-4505</guid>
		<description>awesome....</description>
		<content:encoded><![CDATA[<p>awesome&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giulio Antonio Pallante</title>
		<link>http://www.html5canvastutorials.com/advanced/html5-canvas-oscillation-animation/#comment-3732</link>
		<dc:creator>Giulio Antonio Pallante</dc:creator>
		<pubDate>Fri, 10 Feb 2012 17:48:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.html5canvastutorials.com/?p=988#comment-3732</guid>
		<description>fantastic!!! =)</description>
		<content:encoded><![CDATA[<p>fantastic!!! =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roy M J</title>
		<link>http://www.html5canvastutorials.com/advanced/html5-canvas-oscillation-animation/#comment-3238</link>
		<dc:creator>Roy M J</dc:creator>
		<pubDate>Tue, 24 Jan 2012 09:35:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.html5canvastutorials.com/?p=988#comment-3238</guid>
		<description>Hi Eric, it did not work in my system. I copied all the script and included it in a html page. But when i run the file through browser, just a blank page shows...</description>
		<content:encoded><![CDATA[<p>Hi Eric, it did not work in my system. I copied all the script and included it in a html page. But when i run the file through browser, just a blank page shows&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Rowell</title>
		<link>http://www.html5canvastutorials.com/advanced/html5-canvas-oscillation-animation/#comment-1217</link>
		<dc:creator>Eric Rowell</dc:creator>
		<pubDate>Mon, 05 Sep 2011 21:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.html5canvastutorials.com/?p=988#comment-1217</guid>
		<description>@eddie Thanks!  Here&#039;s a more in-depth explanation of harmonic oscillators:

http://en.wikipedia.org/wiki/Harmonic_oscillator</description>
		<content:encoded><![CDATA[<p>@eddie Thanks!  Here&#8217;s a more in-depth explanation of harmonic oscillators:</p>
<p><a href="http://en.wikipedia.org/wiki/Harmonic_oscillator" rel="nofollow">http://en.wikipedia.org/wiki/Harmonic_oscillator</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eddie</title>
		<link>http://www.html5canvastutorials.com/advanced/html5-canvas-oscillation-animation/#comment-1214</link>
		<dc:creator>eddie</dc:creator>
		<pubDate>Sun, 04 Sep 2011 08:44:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.html5canvastutorials.com/?p=988#comment-1214</guid>
		<description>This is great, I just don&#039;t understand the math. Do you know about some tutorial for that kind of stuff..for lame people?</description>
		<content:encoded><![CDATA[<p>This is great, I just don&#8217;t understand the math. Do you know about some tutorial for that kind of stuff..for lame people?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Rowell</title>
		<link>http://www.html5canvastutorials.com/advanced/html5-canvas-oscillation-animation/#comment-1164</link>
		<dc:creator>Eric Rowell</dc:creator>
		<pubDate>Sat, 20 Aug 2011 07:11:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.html5canvastutorials.com/?p=988#comment-1164</guid>
		<description>Wordpress strips out HTML.  I need to add a parser that converts the html chars into entities so they aren&#039;t stripped away - sorry!!  Coming soon!</description>
		<content:encoded><![CDATA[<p>WordPress strips out HTML.  I need to add a parser that converts the html chars into entities so they aren&#8217;t stripped away &#8211; sorry!!  Coming soon!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Usmaan</title>
		<link>http://www.html5canvastutorials.com/advanced/html5-canvas-oscillation-animation/#comment-925</link>
		<dc:creator>Usmaan</dc:creator>
		<pubDate>Mon, 27 Jun 2011 11:16:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.html5canvastutorials.com/?p=988#comment-925</guid>
		<description>Errr...I pasted the HTML tags in to my comment but they didn&#039;t show........ What gives?</description>
		<content:encoded><![CDATA[<p>Errr&#8230;I pasted the HTML tags in to my comment but they didn&#8217;t show&#8230;&#8230;.. What gives?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Usmaan</title>
		<link>http://www.html5canvastutorials.com/advanced/html5-canvas-oscillation-animation/#comment-924</link>
		<dc:creator>Usmaan</dc:creator>
		<pubDate>Mon, 27 Jun 2011 11:15:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.html5canvastutorials.com/?p=988#comment-924</guid>
		<description>Aby,

I think I know the reason why it&#039;s not working. You need to include   tags on to the document. This tutorial only shows the JavaScript. 

So effectively, your code should look like this:

 
 
     
         
            body {
                margin: 0px;
                padding: 0px;
            }
            
            #myCanvas {
                border: 1px solid #9C9898;
            }
         
         
         
         
            function Rectangle(x, y, width, height, borderWidth){
                this.x = x;
                this.y = y;
                this.width = width;
                this.height = height;
                this.borderWidth = borderWidth;
            }
            
            window.onload = function(){
                var canvas = document.getElementById(&quot;myCanvas&quot;);
                // instantiate new animation object
                var myStage = new Kinetic.Stage(canvas);
                
                var amplitude = 150;
                var centerX = 0;
                var period = 2000; // in ms
                var myRectangle = new Rectangle(250, 70, 100, 50, 5);
                centerX = canvas.width / 2 - myRectangle.width / 2;
                
                // set updateStage method
                myStage.setUpdateStage(function(){
                    var nextX = amplitude *
                    Math.sin(myStage.getTime() *
                    2 *
                    Math.PI /
                    period) +
                    centerX;
                    myRectangle.x = nextX;
                });
                // set drawStage method
                myStage.setDrawStage(function(){
                    var context = myStage.getContext();
                    context.beginPath();
                    context.rect(myRectangle.x, myRectangle.y, myRectangle.width, myRectangle.height);
                    context.fillStyle = &quot;#8ED6FF&quot;;
                    context.fill();
                    context.lineWidth = myRectangle.borderWidth;
                    context.strokeStyle = &quot;black&quot;;
                    context.stroke();
                });
                // start animation
                myStage.start();
            }
         
     
     
         
         
     
</description>
		<content:encoded><![CDATA[<p>Aby,</p>
<p>I think I know the reason why it&#8217;s not working. You need to include   tags on to the document. This tutorial only shows the JavaScript. </p>
<p>So effectively, your code should look like this:</p>
<p>            body {<br />
                margin: 0px;<br />
                padding: 0px;<br />
            }</p>
<p>            #myCanvas {<br />
                border: 1px solid #9C9898;<br />
            }</p>
<p>            function Rectangle(x, y, width, height, borderWidth){<br />
                this.x = x;<br />
                this.y = y;<br />
                this.width = width;<br />
                this.height = height;<br />
                this.borderWidth = borderWidth;<br />
            }</p>
<p>            window.onload = function(){<br />
                var canvas = document.getElementById(&#8220;myCanvas&#8221;);<br />
                // instantiate new animation object<br />
                var myStage = new Kinetic.Stage(canvas);</p>
<p>                var amplitude = 150;<br />
                var centerX = 0;<br />
                var period = 2000; // in ms<br />
                var myRectangle = new Rectangle(250, 70, 100, 50, 5);<br />
                centerX = canvas.width / 2 &#8211; myRectangle.width / 2;</p>
<p>                // set updateStage method<br />
                myStage.setUpdateStage(function(){<br />
                    var nextX = amplitude *<br />
                    Math.sin(myStage.getTime() *<br />
                    2 *<br />
                    Math.PI /<br />
                    period) +<br />
                    centerX;<br />
                    myRectangle.x = nextX;<br />
                });<br />
                // set drawStage method<br />
                myStage.setDrawStage(function(){<br />
                    var context = myStage.getContext();<br />
                    context.beginPath();<br />
                    context.rect(myRectangle.x, myRectangle.y, myRectangle.width, myRectangle.height);<br />
                    context.fillStyle = &#8220;#8ED6FF&#8221;;<br />
                    context.fill();<br />
                    context.lineWidth = myRectangle.borderWidth;<br />
                    context.strokeStyle = &#8220;black&#8221;;<br />
                    context.stroke();<br />
                });<br />
                // start animation<br />
                myStage.start();<br />
            }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Rowell</title>
		<link>http://www.html5canvastutorials.com/advanced/html5-canvas-oscillation-animation/#comment-837</link>
		<dc:creator>Eric Rowell</dc:creator>
		<pubDate>Sat, 04 Jun 2011 19:18:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.html5canvastutorials.com/?p=988#comment-837</guid>
		<description>Aby, what JS error are you seeing?  These tutorials have been fully tested on Chrome, Firefox, Safari, and IE9.  Thanks!</description>
		<content:encoded><![CDATA[<p>Aby, what JS error are you seeing?  These tutorials have been fully tested on Chrome, Firefox, Safari, and IE9.  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aby</title>
		<link>http://www.html5canvastutorials.com/advanced/html5-canvas-oscillation-animation/#comment-836</link>
		<dc:creator>aby</dc:creator>
		<pubDate>Sat, 04 Jun 2011 17:55:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.html5canvastutorials.com/?p=988#comment-836</guid>
		<description>js not working</description>
		<content:encoded><![CDATA[<p>js not working</p>
]]></content:encoded>
	</item>
</channel>
</rss>
