Archives for Beginner Tutorial

I can see your particle remnants: misadventures in alpha blending.

ugly gray trails

Are you fading out images in the HTML5 canvas by painting a transparent black rectangle over the top? Did you test your animation in different browsers? You may be unaware that ugly gray remnants are being left behind. I discuss the problem, how to predict the color of these remnants, and some workarounds.

A simple HTML5 Canvas dragging example using object oriented programming

A new HTML5 Canvas tutorial. We rework our simple example of dragging display objects with the mouse to illustrate object-oriented programming techniques in JavaScript. Display objects are defined by abstract classes which contain methods for drawing and performing hit tests.

Smooth dragging – extending our simple dragging example

A new HTML5 Canvas and JavaScript tutorial. We extend our earlier simple example of dragging objects in the canvas with the mouse. Here, we use a timer-based animation technique with smooth motion, show how to change the layering order of the dislpay objects, and fill the objects with a nice gradient.

Dragging objects – a very simple HTML5 Canvas example

The first of what I hope will be many tutorials at RectangleWorld. A simple example for beginners: drawing objects to the canvas which can be dragged around with the mouse. We will extend this basic example in subsequent tutorials.