How HTML5 Canvas Works

preview_player
Показать описание
Can you explain how HTML5 Canvas works?

HTML5 lets you render dynamic 2D shapes. And HTML5 can be used to update bitmap images.

They make it sound like HTML5 can be used for everything.

The canvas element isn’t for scene graphs. Canvas is considered a drawable region that has defined width and height dimensions.

Canvas is being used for online sketch pads, whether for the 3 year old to doodle or adding markups to stock market graphs depends on the developer.

When Canvas is combined with JavaScript code, you can get dynamically generated graphs. And the ability to mark it up on some websites.

Or I could print off the graph and mark it up personally instead of trying to take a screen shot of the big red X around a stock figure on the webpage’s graph.

Canvas in theory can be used for animation the way Adobe Flash is today.

How do you use it, though?

You call out the Canvas element in HTML using the command canvas ID followed by the dimensions. Then you set the parameters for the Canvas that let someone fill it in using JavaScript.

That would be the dimensional parameters.

Or the color of the mark up shapes the person is allowed to put on.

I heard you could call that all out by CSS instead of JavaScript.

You could. However, if you call it out in CSS, you risk the canvas getting altered as the user’s browser size is resized or based on the device size.

I suppose it is rather useless to have a Canvas that becomes too small to mark up or even see if someone lessens its size.

Depending on the Canvas settings, the Canvas may forget what you draw as soon as you switch tabs or do something else on the page.

As long as I don’t forget how to use it.

Given that they are getting rid of Adobe Flash, you won’t forget given how much you’ll have to practice it.
Рекомендации по теме
Комментарии
Автор

Tips from future:
1. Use more expressive animation
2. Use "real" voice actors instead of generated voice
3. and Boom! subscribers increasing

Good luck!

KangJangkrik