# Two.Polygon
Extends: Two.Path
# Constructor
Argument | Description |
---|---|
x | The x position of the polygon. |
y | The y position of the polygon. |
radius | The radius value of the polygon. |
sides | The number of vertices used to construct the polygon. |
# fromObject
Two.Polygon.fromObject
Returns: Two.Polygon
Argument | Description |
---|---|
obj | Object notation of a Two.Polygon to create a new instance |
Create a new Two.Polygon from an object notation of a Two.Polygon.
# copy
Two.Polygon.copy
Argument | Description |
---|---|
polygon | The reference Two.Polygon |
Copy the properties of one Two.Polygon onto another.
# clone
Two.Polygon.clone
Returns: Two.Polygon
Argument | Description |
---|---|
parent | The parent group or scene to add the clone to. |
Create a new instance of Two.Polygon with the same properties of the current path.
# toObject
Two.Polygon.toObject
Returns: Object
Return a JSON compatible plain object that represents the path.
← Two.Points Two.Star →