W2261 Paths

From Coder Merlin
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

Complex Shapes[edit]

Arbitrarily complex shapes may be constructed using Paths. Paths are built of primitives enabling us to add straight lines or curves and then finally rendering the path by stroking or filling.

Hint.pngHelpful Hint
Practice the below using the Igis Path Demo

Adding Straight Lines[edit]

  • To add a series of points forming lines, we have two options:
    • To move to a new position without drawing a line, we use the moveTo() method on a path.
    • To draw a line to a new position continuing from the previous position, we use the lineTo() method on a path.