Base Shape Class. Acts as a Body's collider. Check out echo.shapes
for all available shapes.
Static variables
Static methods
staticinlinecircle(?x:Float, ?y:Float, ?radius:Float, ?scale_x:Float, ?scale_y:Float):Circle
Gets a Circle
from the Circle Classes' Object Pool. Shortcut for Circle.get()
.
Parameters:
x | The X position of the Circle |
---|---|
y | The Y position of the Circle |
radius | The radius of the Circle |
Returns:
Rect
staticget(options:ShapeOptions):Shape
Gets a Shape. If one is available, it will be grabbed from the Object Pool. Otherwise a new Shape will be created.
Parameters:
options |
---|
Returns:
Shape
Variables
collided:Bool
Flag to determine if the Shape has collided in the last World
step. Used Internally for Debugging.
local_x:Float
The Shape's position on the X axis. For Rects, Circles, and simple Polygons, this position is based on the center of the Shape.
If added to a Body
, this value is treated as an offset to the Body's X position.
local_y:Float
The Shape's position on the Y axis. For Rects, Circles, and simple Polygons, this position is based on the center of the Shape.
If added to a Body
, this value is treated as an offset to the Body's Y position.
rotation:Float
The Shape's angular rotation.
If added to a Body
, this value is relative to the Body's rotation. To get the Shape's local rotation in this case, use local_rotation
.
solid:Bool = true
Flag to set whether the Shape collides with other Shapes.
If false, this Shape's Body will not have its position or velocity affected by other Bodies, but it will still call collision callbacks