Graphics Questions and Answers Latest
Update Already Passed
How do you create a circle in JavaScript graphics?
✔✔ Use new Circle() with a specified radius.
How can you set the color of a shape?
✔✔ Use setColor() with a color name or hex code.
Which command adds a shape to the canvas?
✔✔ add()
How do you remove an object from the canvas?
✔✔ Use remove().
How can you make a rectangle in JavaScript graphics?
✔✔ Use new Rectangle() with width and height.
1
,How do you draw a line between two points?
✔✔ Use new Line() with starting and ending coordinates.
How can you make text appear on the canvas?
✔✔ Use new Text() with the message and font size.
Which method is used to change the position of an object?
✔✔ setPosition()
How do you make an object move smoothly across the screen?
✔✔ Use a while loop with move().
How can you change the background color of the canvas?
✔✔ Use setBackgroundColor().
How do you make an object visible after hiding it?
✔✔ Use add() again to add it back to the canvas.
2
, Which command is used to draw an oval?
✔✔ Use new Oval() with width and height.
How can you change the font size of displayed text?
✔✔ Use setFont() with the desired size.
How do you make an object move up the screen?
✔✔ Use move(0, -distance).
How can you create a gradient effect?
✔✔ Overlay semi-transparent shapes with different colors.
How do you check if two objects are touching?
✔✔ Use getX() and getY() to compare positions.
Which method changes the size of a shape?
✔✔ Use setSize() or setRadius() for circles.
3