<script></script>
at bottom of body element<canvas></canvas>
element# Canvas
<canvas></canvas>
only uses width
and height
which can also be set using DOM, either way they are both optional.
Canvas ID element is global so it is best to always us ID so it can be more easily identified
FALLBACK CONTENT
-provide fallback content so it can be displayed in older browsers by placing alternat conent inside of the element
RENDERING CONTEXT
rendering contexts create and manipulate the displayed content.
to display content, render content using getContext
after getting element by id
CHECK FOR SUPPORT by using getContext
The coordinate space/grid uses (x,y)
coordinates for position and rotations
DRAW USING CANVAS
draw, fill and outline rectangles or make them fully tranparent
Create paths using drawing commands - then you can stroke or fill path to render it
globalAlpha
propery or assigning style using RGBACanvasGradient
object can be assignt fill/stroke style propertiescreatePatter()
shadow
. OffsetX, OffsetY, Blur and Colorrender using:
fillText (text,x,y[, maxWidth])
strokeText(text, x, y [, maxWidth])
Style text
font = value textAlign = value textBaseline = value direction = value