Constructor
new Bounds(p5, polygon)
Create a new Bounds object
Parameters:
Name | Type | Description |
---|---|---|
p5 |
object | Reference to global instance of p5.js for drawing |
polygon |
array | Array of sequential points in the format of [polygon_n][x1][y1], ... |
Methods
contains(point) → {boolean}
Test if a given point is within this Bounds polygon
Parameters:
Name | Type | Description |
---|---|---|
point |
array | Coordinates of point to test ([x,y]) |
Returns:
- Type
- boolean
draw()
Draws this Bounds polygon to the canvas