HTML5 Canvas Drawing Lines with Smooth Edges

In the previous post we kicked off with our painting application using HTML5 canvas. If you remember well, we ended up with a basic app where one can easily draw lines or something else with a “pencil” tool. But there was a problem. When drawing different shapes like circles, the lines/curves had jagged edges. They were not smooth or anti-aliased, whatever you want to call them. This article will aim towards solving those issues.

Continue reading “HTML5 Canvas Drawing Lines with Smooth Edges”

Calculate Control Point to Make Your Canvas Curve Hit a Specific Point

Creating curves in HTML5 Canvas is usually achieved with quadraticCurveTo() that has 1 control point or bezierCurveTo() that has 2 control points. In some cases, it might be highly desirable to control the point that the curve hits when drawing with quadraticCurveTo. It is pretty simple, but can be a bit tricky. All it requires, is a little formula that we’ll see in a bit.

Continue reading “Calculate Control Point to Make Your Canvas Curve Hit a Specific Point”

Creating a Paint Application with HTML5 Canvas

Let’s build a simple painting (or sketching) application using HTML5 <canvas> element along with its Javascript API. Although the app will be small, there’s going to be quite a bit of information for intake. So I’ll break the entire process into different tutorials (posts).
Continue reading “Creating a Paint Application with HTML5 Canvas”

17 Neat HTML5 Games To Keep You Busy This Weekend

Flash games are old and technology is advancing. I have collected some amazing HTML5 games that you can play this weekend and keep yourself busy. They are in random order (no ranking or anything else). Make sure you are using a modern browser that supports HTML5 and Canvas.

Continue reading “17 Neat HTML5 Games To Keep You Busy This Weekend”

20+ Best Canvas Tutorials and Examples That Will Make You A Canvas Master

Every now and then a new technology releases giving better features and advantages over the previous ones but learning them all without spending a lot of time can be a pain. HTML5 <canvas> element is one of those technologies which is used to draw graphics, on the fly, on a web page via scripting (normally JavaScript). Learning <canvas> is not hard at all but due to a lack of good tutorials around the web makes it difficult to understand, specifically for newcomers.

Continue reading “20+ Best Canvas Tutorials and Examples That Will Make You A Canvas Master”

How I Created My Version of Doodle Jump in HTML5

I’ll try to take you through my process of re-creating the famous Doodle Jump (which was originally released for mobile platforms) in HTML5 from scratch. The entire write up might help you with creating your own games from scratch!

Continue reading “How I Created My Version of Doodle Jump in HTML5”