Skip to main content
Version: Phaser v4.0.0-rc.6

Ellipse

An Elliptical Curve derived from the Base Curve class.

See https://en.wikipedia.org/wiki/Elliptic_curve for more details.

Constructor

new Ellipse([x], [y], [xRadius], [yRadius], [startAngle], [endAngle], [clockwise], [rotation])

Parameters

nametypeoptionaldefaultdescription
xnumber | Phaser.Types.Curves.EllipseCurveConfigYes0The x coordinate of the ellipse, or an Ellipse Curve configuration object.
ynumberYes0The y coordinate of the ellipse.
xRadiusnumberYes0The horizontal radius of ellipse.
yRadiusnumberYes0The vertical radius of ellipse.
startAnglenumberYes0The start angle of the ellipse, in degrees.
endAnglenumberYes360The end angle of the ellipse, in degrees.
clockwisebooleanYesfalseWhether the ellipse angles are given as clockwise (true) or counter-clockwise (false).
rotationnumberYes0The rotation of the ellipse, in degrees.

Scope: static

Extends

Phaser.Curves.Curve

Source: src/curves/EllipseCurve.js#L16
Since: 3.0.0

Inherited Members

From Phaser.Curves.Curve:


Public Members

angle

angle: number

Description:

The rotation of the ellipse, relative to the center, in degrees.

Source: src/curves/EllipseCurve.js#L536
Since: 3.14.0


clockwise

clockwise: boolean

Description:

true if the ellipse rotation is clockwise or false if anti-clockwise.

Source: src/curves/EllipseCurve.js#L515
Since: 3.0.0


endAngle

endAngle: number

Description:

The end angle of the ellipse in degrees.

Source: src/curves/EllipseCurve.js#L494
Since: 3.0.0


p0

p0: Phaser.Math.Vector2

Description:

The center point of the ellipse. Used for calculating rotation.

Source: src/curves/EllipseCurve.js#L71
Since: 3.0.0


rotation

rotation: number

Description:

The rotation of the ellipse, relative to the center, in radians.

Source: src/curves/EllipseCurve.js#L557
Since: 3.0.0


startAngle

startAngle: number

Description:

The start angle of the ellipse in degrees.

Source: src/curves/EllipseCurve.js#L473
Since: 3.0.0


x

x: number

Description:

The x coordinate of the center of the ellipse.

Source: src/curves/EllipseCurve.js#L389
Since: 3.0.0


xRadius

xRadius: number

Description:

The horizontal radius of the ellipse.

Source: src/curves/EllipseCurve.js#L431
Since: 3.0.0


y

y: number

Description:

The y coordinate of the center of the ellipse.

Source: src/curves/EllipseCurve.js#L410
Since: 3.0.0


yRadius

yRadius: number

Description:

The vertical radius of the ellipse.

Source: src/curves/EllipseCurve.js#L452
Since: 3.0.0


Inherited Methods

From Phaser.Curves.Curve:


Public Methods

fromJSON

<static> fromJSON(data)

Description:

Creates a curve from the provided Ellipse Curve Configuration object.

Parameters:

nametypeoptionaldescription
dataPhaser.Types.Curves.JSONEllipseCurveNoThe JSON object containing this curve data.

Returns: Phaser.Curves.Ellipse - The ellipse curve constructed from the configuration object.

Source: src/curves/EllipseCurve.js#L603
Since: 3.0.0


getPoint

<instance> getPoint(t, [out])

Description:

Get point at relative position in curve according to length.

Tags:

  • generic

Parameters:

nametypeoptionaldescription
tnumberNoThe position along the curve to return. Where 0 is the start and 1 is the end.
outPhaser.Math.Vector2YesA Vector2 object to store the result in. If not given will be created.

Returns: Phaser.Math.Vector2 - The coordinates of the point on the curve. If an out object was given this will be returned.

Source: src/curves/EllipseCurve.js#L177
Since: 3.0.0


getResolution

<instance> getResolution(divisions)

Description:

Get the resolution of the curve.

Parameters:

nametypeoptionaldescription
divisionsnumberNoOptional divisions value.

Returns: number - The curve resolution.

Source: src/curves/EllipseCurve.js#L162
Since: 3.0.0


getStartPoint

<instance> getStartPoint([out])

Description:

Gets the starting point on the curve.

Tags:

  • generic

Parameters:

nametypeoptionaldescription
outPhaser.Math.Vector2YesA Vector2 object to store the result in. If not given will be created.

Overrides: Phaser.Curves.Curve#getStartPoint

Returns: Phaser.Math.Vector2 - The coordinates of the point on the curve. If an out object was given this will be returned.

Source: src/curves/EllipseCurve.js#L143
Since: 3.0.0


setClockwise

<instance> setClockwise(value)

Description:

Sets if this curve extends clockwise or anti-clockwise.

Parameters:

nametypeoptionaldescription
valuebooleanNoThe clockwise state of this curve.

Returns: Phaser.Curves.Ellipse - This curve object.

Source: src/curves/EllipseCurve.js#L355
Since: 3.0.0


setEndAngle

<instance> setEndAngle(value)

Description:

Sets the end angle of this curve.

Parameters:

nametypeoptionaldescription
valuenumberNoThe end angle of this curve, in radians.

Returns: Phaser.Curves.Ellipse - This curve object.

Source: src/curves/EllipseCurve.js#L338
Since: 3.0.0


setHeight

<instance> setHeight(value)

Description:

Sets the height of this curve.

Parameters:

nametypeoptionaldescription
valuenumberNoThe height of this curve.

Returns: Phaser.Curves.Ellipse - This curve object.

Source: src/curves/EllipseCurve.js#L304
Since: 3.0.0


setRotation

<instance> setRotation(value)

Description:

Sets the rotation of this curve.

Parameters:

nametypeoptionaldescription
valuenumberNoThe rotation of this curve, in radians.

Returns: Phaser.Curves.Ellipse - This curve object.

Source: src/curves/EllipseCurve.js#L372
Since: 3.0.0


setStartAngle

<instance> setStartAngle(value)

Description:

Sets the start angle of this curve.

Parameters:

nametypeoptionaldescription
valuenumberNoThe start angle of this curve, in radians.

Returns: Phaser.Curves.Ellipse - This curve object.

Source: src/curves/EllipseCurve.js#L321
Since: 3.0.0


setWidth

<instance> setWidth(value)

Description:

Sets the width of this curve.

Parameters:

nametypeoptionaldescription
valuenumberNoThe width of this curve.

Returns: Phaser.Curves.Ellipse - This curve object.

Source: src/curves/EllipseCurve.js#L287
Since: 3.0.0


setXRadius

<instance> setXRadius(value)

Description:

Sets the horizontal radius of this curve.

Parameters:

nametypeoptionaldescription
valuenumberNoThe horizontal radius of this curve.

Returns: Phaser.Curves.Ellipse - This curve object.

Source: src/curves/EllipseCurve.js#L253
Since: 3.0.0


setYRadius

<instance> setYRadius(value)

Description:

Sets the vertical radius of this curve.

Parameters:

nametypeoptionaldescription
valuenumberNoThe vertical radius of this curve.

Returns: Phaser.Curves.Ellipse - This curve object.

Source: src/curves/EllipseCurve.js#L270
Since: 3.0.0


toJSON

<instance> toJSON()

Description:

JSON serialization of the curve.

Returns: Phaser.Types.Curves.JSONEllipseCurve - The JSON object containing this curve data.

Source: src/curves/EllipseCurve.js#L578
Since: 3.0.0