new star(options){star}
Initializes a new star instance.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Options used to customize the star
|
Returns:
Type | Description |
---|---|
star | A new star instance. |
Requires
Members
-
dasharray*
-
The stroke-dasharray of the polygon
-
dashoffset*
-
The stroke-dashoffset of the polygon
-
readonlyelSVGElement
-
The polygon element associated with this instance
-
fillString
-
The star's fill color
-
readonlyidString
-
The id of this instance's polygon element
-
readonlyparentSVGElement
-
The parent of the polygon element
-
pointsint
-
The number of points on the polygon
-
r1Number
-
First radius of the star
-
r2Number
-
Second radius of the star
-
sliceString
-
Control how much of the polygon's stroke is drawn. Space-delimited values define a slice, ie '10 30'. A single value asserts 0 as the starting value. Accepts percentages for relative values
-
strokeString
-
The star's stroke color
-
strokeWidthNumber
-
The star's stroke width
-
xNumber
-
The origin of the polygon along the x-axis
-
yNumber
-
The origin of the polygon along the y-axis
Methods
-
staticstar.getElInstance(el){star}
-
returns the star instance associated with the provided element's id attribute
Name Type Description el
Element The element with the lookup id Returns:
Type Description star The associate star, if it exists -
staticstar.getInstance(id){star}
-
returns the star instance associated with the id
Name Type Description id
String The lookup id Returns:
Type Description star The associate star, if it exists -
getPoint(index){Array}
-
Returns the coordinates at the specified index
Name Type Default Description index
int -1 optional The index of the desired point. When negative, becomes the sum of itself and the length of the points array Returns:
Type Description Array The coordinates at the specified index -
update()
-
Updates the points attribute of the polygon element.