Implement a simple 2d Circle.
Kind: global class
Circle
Boolean
Boolean
\*
Create the Circle.
Param | Type | Description |
---|---|---|
center | Vector2 |
Circle center position. |
radius | Number |
Circle radius. |
Circle
Return a clone of this circle.
Kind: instance method of Circle
Returns: Circle
- Cloned circle.
Boolean
Check if this circle contains a Vector2.
Kind: instance method of Circle
Returns: Boolean
- if point is contained within the circle.
Param | Type | Description |
---|---|---|
p | Vector2 |
Point to check. |
Boolean
Check if equal to another circle.
Kind: instance method of Circle
Returns: Boolean
- True if circles are equal, false otherwise.
Param | Type | Description |
---|---|---|
other | Circle |
Other circle to compare to. |
\*
Convert to dictionary.
Kind: instance method of Circle
Returns: \*
- Dictionary with {center, radius}.
Param | Type | Description |
---|---|---|
minimized | Boolean |
If true, will not include keys that their values are 0. You can use fromDict on minimized dicts. |
Circle
Create circle from a dictionary.
Kind: static method of Circle
Returns: Circle
- Newly created circle.
Param | Type | Description |
---|---|---|
data | \* |
Dictionary with {center, radius}. |
Circle
Lerp between two circle.
Kind: static method of Circle
Returns: Circle
- result circle.
Param | Type | Description |
---|---|---|
p1 | Circle |
First circle. |
p2 | Circle |
Second circle. |
a | Number |
Lerp factor (0.0 - 1.0). |