tags:

views:

213

answers:

3

I'm a little confused to what html5 canvas is. I've been told it is javascript, but it seems to be a much bigger deal?

  1. What makes it different than javascript?

  2. Why is it so amazing?

  3. Does it do other things than javascript?

Thanks,

Dan

+2  A: 

I suggest you read this article HTML5 Canvas - the basics

But in short. It does not replace javascript.

HTML 5 canvas gives you an easy and powerful way to draw graphics using JavaScript. For each canvas element you can use a "context" (think about a page in a drawing pad), into which you can issue JavaScript commands to draw anything you want. Browsers can implement multiple canvas contexts and the different APIs provide the drawing functionality.

Nifle
+1  A: 

The canvas is basically an img element that you can draw on using javascript.

Tor Valamo
+1  A: 

The Canvas element is essentially a drawing canvas that can be painted on programmatically; a sort of scriptable bitmap drawing tool for the web.

I suppose the "amazing" thing about it, apart from the fact that we can now all create web-based MS Paint clones with ease, is that you have a much richer, completely free-form area for creating complex graphics client-side and on-the-fly. You can draw pretty graphs, or do things with photos. Allegedly, you can also do animation!

Mozilla's Developer Center has a reasonable tutorial if you want to try it out.

Rob
The animation bit is something you'll have to implement yourself though. The canvas itself has no support for frames or movement.
Tor Valamo