W2261 Paths
From Coder Merlin
Revision as of 12:02, 11 June 2019 by Chukwuemeka-tinashe (talk | contribs) (→Adding Straight Lines)
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.
Helpful 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.