Vocabulary Latest Update 100% Correct
What does `setLineWidth(width);` do in JavaScript graphics?
✔✔ It changes the thickness of the lines used in drawing.
What is the default color for shapes in JavaScript graphics?
✔✔ Black.
How do you animate an object in JavaScript graphics?
✔✔ Use a loop or `setInterval()` to update its position over time.
How can you make a shape invisible without removing it from the canvas?
✔✔ Use `setColor("transparent");` or `setOpacity(0);`.
What does `getHeight();` return when used on a graphical object?
✔✔ The height of the object in pixels.
1
, What function is used to rotate a shape in JavaScript graphics?
✔✔ JavaScript graphics do not support rotation by default, but you can simulate rotation by
redrawing the shape at different angles.
How do you make a shape change size dynamically?
✔✔ Update its width and height inside a loop or event listener.
How can you detect when the user clicks on a shape?
✔✔ Use `mouseClickMethod(callbackFunction);` and check `getElementAt(x, y);`.
How do you create a gradient in JavaScript graphics?
✔✔ JavaScript graphics do not support gradients directly, but you can simulate them by drawing
multiple shapes with different colors.
How do you bring an object to the front in JavaScript graphics?
✔✔ Remove it from the canvas and re-add it to bring it to the top.
How do you make text bold in JavaScript graphics?
2