Hello Canvas!
How to use line, text, shadow
About line
moveTo(x,y)
lineTo(x,y)
strokeStyle
stroke
beginPath
move to starting point with coordinate x and y.
Draw a line to this point from starting point. Again x and y being the coordinate.
CSS color of the line
A method to actually make javascript draw a line
Before you start drawing a new line with different color, you will have to call "beginPath".
About text
fillText(text,x,y)
strokeText(text,x,y)
strokeStyle
fillStyle
font
textBaseline
Print the text with solid color within. Text color is determined by fillStyle().
Print the text with only color the outline of the text. Text color is set by strokeStyle().
CSS color for text that call strokeText
CSS color for text that call fillText
CSS font style such as "bold, 10px, san-serif"
This is a little bit tricky to explain. We will need another demo. The value for this propery can be "top", "hanging","middle", "alphabetic", " eographic" and "bottom". Default value is "alphabetic".
About shadow
shadowOffsetX
shadowOffsetY
shadowBlur
shadowColor
Horizontal distance (x-axis) between the shadow and the shape in pixel.
Vertical distance (y-axis) between the shadow and the shape in pixel.
How blur you want your shadow to be.
Obviously, this is to set the color of your shadow
'my_lesson > _HTML5' 카테고리의 다른 글
7. HTML5 Canvas [drawimage, xPos, yPos] (0) | 2015.03.25 |
---|---|
6. HTML5 Canvas [translate, rotate, scale, save, restore] (0) | 2015.03.25 |
4. HTML5 Canvas [stroke,fill, clear, gradient] (0) | 2015.03.25 |
3. HTML5 구성요소 (0) | 2013.08.18 |
2. HTML5 Contents Model 설명 (0) | 2013.07.21 |
댓글