Optionalx: number
The x position of the center of the circle. Default 0.
Optionaly: number
The y position of the center of the circle. Default 0.
Optionalradius: number
The radius of the circle. Default 0.
The bottommost point of the Circle, equal to y + radius. Setting this value adjusts the
y position of the circle's center while keeping the radius unchanged.
The diameter of the Circle, which is twice the radius. Setting this value also updates the radius accordingly.
The leftmost point of the Circle, equal to x - radius. Setting this value adjusts the
x position of the circle's center while keeping the radius unchanged.
The radius of the Circle. Setting this value also updates the diameter accordingly.
The rightmost point of the Circle, equal to x + radius. Setting this value adjusts the
x position of the circle's center while keeping the radius unchanged.
The topmost point of the Circle, equal to y - radius. Setting this value adjusts the
y position of the circle's center while keeping the radius unchanged.
ReadonlytypeThe geometry constant type of this object: GEOM_CONST.CIRCLE.
Used for fast type comparisons.
The x position of the center of the circle.
The y position of the center of the circle.
Check to see if the Circle contains the given x / y coordinates.
The x coordinate to check within the circle.
The y coordinate to check within the circle.
True if the coordinates are within the circle, otherwise false.
Returns a Point object containing the coordinates of a point on the circumference of the Circle based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point at 180 degrees around the circle.
A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle.
Optionalout: O
A Vector2 to store the return values in. If not given a Vector2 object will be created.
A Vector2 containing the coordinates of the point around the circle.
Returns an array of Point objects containing the coordinates of the points around the circumference of the Circle, based on the given quantity or stepRate values.
The amount of points to return. If a falsy value the quantity will be derived from the stepRate instead.
OptionalstepRate: number
Sets the quantity by getting the circumference of the circle and dividing it by the stepRate.
Optionaloutput: O
An array to insert the Vector2s in to. If not provided a new array will be created.
An array of Vector2 objects pertaining to the points around the circumference of the circle.
Checks to see if the Circle is empty: has a radius of zero.undefined
True if the Circle is empty, otherwise false.
Sets this Circle to be empty with a radius of zero. Does not change its position.undefined
This Circle object.
Sets the position of this Circle. If the y argument is omitted, both the x and y
positions will be set to the value of x.
Optionalx: number
The x position of the center of the circle. Default 0.
Optionaly: number
The y position of the center of the circle. Default 0.
This Circle object.
Sets the x, y and radius of this circle.
Optionalx: number
The x position of the center of the circle. Default 0.
Optionaly: number
The y position of the center of the circle. Default 0.
Optionalradius: number
The radius of the circle. Default 0.
This Circle object.
StaticAreaCalculates the area of the circle.
The Circle to get the area of.
The area of the Circle.
StaticCircumferenceReturns the circumference of the given Circle.
The Circle to get the circumference of.
The circumference of the Circle.
StaticCircumferenceStaticCloneStaticContainsCheck to see if the Circle contains the given x / y coordinates.
The Circle to check.
The x coordinate to check within the circle.
The y coordinate to check within the circle.
True if the coordinates are within the circle, otherwise false.
StaticContainsCheck to see if the Circle contains the given x and y coordinates as stored in the Vector2.
True if the Vector2 coordinates are within the circle, otherwise false.
StaticContainsCheck to see if the Circle contains all four points of the given Rectangle object.
True if all of the Rectangle coordinates are within the circle, otherwise false.
StaticCopyStaticEqualsStaticGetStaticGetReturns a Vector2 object containing the coordinates of a point on the circumference of the Circle based on the given angle normalized to the range 0 to 1. I.e. a value of 0.5 will give the point at 180 degrees around the circle.
The Circle to get the circumference point on.
A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle.
Optionalout: O
A Vector2 instance to store the return values in. If not given a new Vector2 object will be created.
A Vector2 containing the coordinates of the point around the circle.
StaticGetReturns an array of Vector2 objects containing the coordinates of the points around the circumference of the Circle, based on the given quantity or stepRate values.
The Circle to get the points from.
The amount of points to return. If a falsy value the quantity will be derived from the stepRate instead.
OptionalstepRate: number
Sets the quantity by getting the circumference of the circle and dividing it by the stepRate.
Optionalout: any[]
An array to insert the points in to. If not provided a new array will be created.
An array of Vector2 objects pertaining to the points around the circumference of the circle.
StaticOffsetStaticOffsetStaticRandom
A Circle geometry object defined by a center position and radius.
This is a geometry object, containing numerical values and related methods to inspect and modify them. It is not a Game Object, in that you cannot add it to the display list, and it has no texture. To render a Circle you should look at the capabilities of the Graphics class.
Circle objects are commonly used for hit-testing, overlap checks, masking, and defining circular regions of interest within a Scene. They can be used directly with Phaser's geometry intersection methods, such as
Phaser.Geom.Intersects.CircleToCircleorPhaser.Geom.Intersects.CircleToRectangle, making them useful for simple spatial queries without requiring a physics body.