Constructor
new Tangle(mask, options)
Create a new Tangle
Parameters:
Name | Type | Description |
---|---|---|
mask |
Array.<Point> | Polygon | Vertices of a polygon used as a mask. Only the portion of the tangle inside the polygon will be visible. |
options |
TangleOptions | A map of values to be loaded into instance variables. |
Methods
applyMask()
Apply the mask polygon to this tangle. Only the portion of the tangle inside the mask polygon will be displayed.
collisionTest(poly) → {boolean}
Test an polygon for collisions with existing polygons.
Parameters:
Name | Type | Description |
---|---|---|
poly |
Array.<p5.Vector> | The polygon to test. |
Returns:
True if there is a collision.
- Type
- boolean
execute()
Build the tangle. Executes the this.build method with before and after processing appropriate to the tangle type. This is normally the last method called by a child class.
paste(position)
Paste the graphics buffer onto the canvas at the specified position .
Parameters:
Name | Type | Description |
---|---|---|
position |
Point | The position at which to place the image on the canvas. |