Game Development Reference
In-Depth Information
The polyline is shown on the left side of the preceding screenshot, while the shape
on the right is a polygon that uses the exact same points to describe its position and
orientation. The only difference between the two is that a polygon is forcefully closed.
Of course, we can also simulate that behavior using a polyline by simply manually
connecting the last point with the first.
SVG also allows us to draw very complex shapes with smooth curves, instead of
the line-based shapes covered previously. To do so, we can use the path element,
which might be a little complex at first, as it has several different attributes we can
manipulate. One key feature of paths is that it allows us to either move the pointer to
a location within the coordinate space, or to draw a line to a point.
All path attributes that describe the path are put inside the d attribute. These attrib-
utes are as follows:
M : move to
L : line to
H : horizontal line to
V : vertical line to
• C: curve to
S : smooth curve to
Search WWH ::




Custom Search