Design a Happy Halloween Porter using HTML and CSS
- lineTo(x, y): This function is used to draw a line from the current location of the canvas pointer to a specified point that has x and y coordinates.
- arc(x, y, a1, a2, direction): We can utilize this function to draw arcs which can be half circle, full circle, or any part of the circle depending on starting angle and ending angle given which is a1 and a2 in radians. Also, we can specify coordinates of the center of the circle which is x and y.
- moveTo(x, y): There might be times when we have to move the pen from the current point to some other point but without drawing any line or anything, so this function can be used to just move the pen to a point whose coordinates will be x and y.
- strokeText(“text”, x, y): This function can be used to insert text inside canvas at the specified point with coordinates x and y.
- stroke(), fill(): All above functions are of no use if we do not use these functions to command the canvas when to draw/stroke something and when to fill colors in a figure.
- beginPath(), closePath(): These functions need to be used to tell the canvas when to start/end a path.
Properties of canvas:
- strokeStyle: It defines the color of the line.
- fillStyle: It defines the color used to fill figures.
- lineJoin: It defines the way lines will be at the joints.
- lineCap: It defines how the ends of a line should look like.
- font: It defines the font style and size of the text.
We will utilize the above functions & properties the design Halloween.