Media

INFO PAGE

Canvas Introduction

Canvas Coding

The Canvas tag was introduced in HTML 5. You can dynamically draw shapes and text onto the canvas with JavaScript.

// HTML
<canvas id="myCanvas"></canvas>

// JAVASCRIPT
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
context.fillStyle = "blue";
context.fillRect(0, 0, 200, 150);

In theory, the Canvas is a replacement for Adobe Flash. But really, the Canvas is the same as the Flash Bitmap class that was introduced in 2005 - ten years earlier. At the time, the Bitmap class was a powerful and very well received addition to Flash, but Flash also had 50 other classes as well as a full-blown Object Oriented Programming language and best-in-class visual editor to make interactive media. The announcement of the Canvas led to a lot of initial interest but, unfortunately, the conveniences to code on the Canvas were not there at the start.

CreateJS / EaselJS

CreateJS / EaselJS Libraries

EaselJS is one of several popular open source libraries to make it easier to use the canvas. EaselJS is part of the CreateJS library and is a module used to make general Interactive Media such as games, generative art, and highly graphical experiences. It provides a hierarchical display list, a robust interaction model and helper classes.

// HTML
<canvas id="myCanvas"></canvas>

// JAVASCRIPT
var stage = new createjs.Stage("myCanvas");
var rect = new createjs.Shape();
rect.graphics.beginFill("blue").drawRect(0, 0, 200, 150);
rect.x = 100; rect.y = 100;
stage.addChild(rect);
stage.update();
rect.on("click", function() {rect.x = 200; stage.update();});

CreateJS was built by Grant Skinner (Flash background) and his team in Canada. CreateJS was made famous in the early days of the Canvas when it was used to remake a number of Atari games. You can export assets directly from Adobe Animate to CreateJS and also from TexturePacker to CreateJS for SpriteSheets. CreateJS has been loaded billions of times and is considered to be cached by the Internet Advertising Bureau and so not part of ad sizes.

ZIM - Code Creativity!

ZIM - Code Creativity

ZIM is an open source JavaScript framework for the Canvas. ZIM is powered by CreateJS and provides many conveniences, components and controls such as one-line drag and drop, multiple types of hit tests, buttons, sliders, dials, etc. as well as responsive design layout, page control, accessibility, style, particle emitters, parallax and much more.

new Rectangle(200, 150, blue)
	.center()
	.drag();

ZIM was built by Canadian New Media Award winner, Dr Abstract. ZIM is an official tool on the CreateJS site. While CreateJS has remained stable for about 8 years providing a solid base, ZIM has been rapidly growing and is now on ZIM 015:

Making digital environments in which people cancreate, communicate and play