Static methods

@:value({ scale_y : 1, scale_x : 1, rotation : 0, radius : 1, y : 0, x : 0 })staticinlineget(x:Float = 0, y:Float = 0, radius:Float = 1, rotation:Float = 0, scale_x:Float = 1, scale_y:Float = 1):Circle

Gets a Cirlce from the pool, or creates a new one if none are available. Call put() on the Cirlce to place it back in the pool.

Parameters:

x
y
radius
rotation

Returns:

Circle

Variables

diameter:Float

The diameter of the Circle.

local_radius:Float

The local radius of the Circle, which represents the Circle's radius with no transformations.

@:value(false)read onlypooled:Bool = false

radius:Float

The radius of the Circle, transformed with scale_x. Use local_radius to get the untransformed radius.

Methods

inlineload(circle:Circle):Circle

@:value({ scale_y : 1, scale_x : 1, rotation : 0, radius : 1, y : 0, x : 0 })inlineset(x:Float = 0, y:Float = 0, radius:Float = 1, rotation:Float = 0, scale_x:Float = 1, scale_y:Float = 1):Circle

Inherited Variables

Defined by Shape

read onlybottom:Float

The Lower Bounds of the Shape.

collided:Bool

Flag to determine if the Shape has collided in the last World step. Used Internally for Debugging.

read onlyleft:Float

The Left Bounds of the Shape.

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.

read onlyright:Float

The Right Bounds of the Shape.

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.

@:value(true)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

read onlytop:Float

The Upper Bounds of the Shape.

@:value(new Transform())transform:Transform = new Transform()

type:ShapeType

Enum value determining what shape this Object is (Rect, Circle, Polygon).

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 relative to the Body's X position. To get the Shape's local X position in this case, use local_x.

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 relative to the Body's Y position. To get the Shape's local Y position in this case, use local_y.

Inherited Methods

Defined by Shape

inlineget_position():Vector2

Gets the Shape's position on the X and Y axis as a Vector2.

inlineset_position(position:Vector2):Void