Game Development Reference
In-Depth Information
<polyline
points="50, 10, 100, 50, 30, 100, 175, 300,
250, 10, 10, 400"
fill="#fff"
stroke="#c00"
stroke-width="10"/>
</svg>
The next shape we'll look at is the polygon. Scarily similar to a polyline, the polygon
is drawn exactly in the same way as a polyline, but with two very important distinc-
tions. First, a polygon must have at least three points. Secondly, a polygon is always
a closed shape. This means that the last point and the first point of the sequence are
physically connected, whereas in a polyline, that connection is only made by the fill,
if one is assigned to the polyline:
<svg xmlns="http://www.w3.org/2000/svg"
version="1.1" width="1000" height="1000">
<polygon
points="50, 10, 100, 50, 30, 100, 175,
300, 250, 10, 10, 400"
fill="#fff"
stroke="#c00"
stroke-width="10"/>
</svg>
Search WWH ::




Custom Search