The horizontal position of the light.
The vertical position of the light.
The radius of the light.
The red color of the light. A value between 0 and 1.
The green color of the light. A value between 0 and 1.
The blue color of the light. A value between 0 and 1.
The intensity of the light.
Optionalz: numberThe z position of the light. If not given, it will be set to radius * 0.1.
The bottom position of the Circle.
A bitmask that controls if this Game Object is drawn by a Camera or not.
Not usually set directly, instead call Camera.ignore, however you can
set this property directly using the Camera.id property:
The color of the light.
The diameter of the Circle.
The height of this Light Game Object. This is the same as Light.diameter.
The horizontal display origin of this Game Object. The origin is a normalized value between 0 and 1. The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin.
The vertical display origin of this Game Object. The origin is a normalized value between 0 and 1. The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin.
The width of this Light Game Object. This is the same as Light.diameter.
The height of this Light Game Object. This is the same as Light.diameter.
The intensity of the light.
The left position of the Circle.
ReadonlyoriginThe horizontal origin of this Game Object.
The origin maps the relationship between the size and position of the Game Object.
The default value is 0.5, meaning all Game Objects are positioned based on their center.
Setting the value to 0 means the position now relates to the left of the Game Object.
Set this value with setOrigin().
ReadonlyoriginThe vertical origin of this Game Object.
The origin maps the relationship between the size and position of the Game Object.
The default value is 0.5, meaning all Game Objects are positioned based on their center.
Setting the value to 0 means the position now relates to the top of the Game Object.
Set this value with setOrigin().
The radius of the Circle.
The flags that are compared against RENDER_MASK to determine if this Game Object will render or not.
The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively.
If those components are not used by your custom class then you can use this bitmask as you wish.
The right position of the Circle.
The horizontal scroll factor of this Game Object.
The scroll factor controls the influence of the movement of a Camera upon this Game Object.
When a camera scrolls it will change the location at which this Game Object is rendered on-screen. It does not change the Game Objects actual position values.
A value of 1 means it will move exactly in sync with a camera. A value of 0 means it will not move at all, even if the camera moves. Other values control the degree to which the camera movement is mapped to this Game Object.
Please be aware that scroll factor values other than 1 are not taken in to consideration when calculating physics collisions. Bodies always collide based on their world position, but changing the scroll factor is a visual adjustment to where the textures are rendered, which can offset them from physics bodies if not accounted for in your code.
The vertical scroll factor of this Game Object.
The scroll factor controls the influence of the movement of a Camera upon this Game Object.
When a camera scrolls it will change the location at which this Game Object is rendered on-screen. It does not change the Game Objects actual position values.
A value of 1 means it will move exactly in sync with a camera. A value of 0 means it will not move at all, even if the camera moves. Other values control the degree to which the camera movement is mapped to this Game Object.
Please be aware that scroll factor values other than 1 are not taken in to consideration when calculating physics collisions. Bodies always collide based on their world position, but changing the scroll factor is a visual adjustment to where the textures are rendered, which can offset them from physics bodies if not accounted for in your code.
The top position of the Circle.
ReadonlytypeThe geometry constant type of this object: GEOM_CONST.CIRCLE.
Used for fast type comparisons.
The visible state of the Game Object.
An invisible Game Object will skip rendering, but will still process update logic.
The width of this Light Game Object. This is the same as Light.diameter.
The x position of the center of the circle.
The y position of the center of the circle.
The z position of the light. This affects the relief effect created by the light. A higher value will make the light appear more raised.
Lit game objects are considered to be at z=0. Thus, if z is larger than the radius of the light, the light will not affect them. Strong values are in the range of 0 to radius/2.
This is not a true position, and won't be affected by
perspective or camera position. It won't be set by setTo.
Use setZ to set it, or setZNormal to set it to a fraction
of the radius.
The z position of the light, as a fraction of the radius. This affects the relief effect created by the light. A higher value will make the light appear more raised. Strong values are in the range of 0 to 0.5.
Static ReadonlyRENDER_The bitmask that GameObject.renderFlags is compared against to determine if the Game Object will render or not.
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.
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: OA Vector2 to store the return values in. If not given a Vector2 object will be created.
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 falsey value the quantity will be derived from the stepRate instead.
OptionalstepRate: numberSets the quantity by getting the circumference of the circle and dividing it by the stepRate.
Optionaloutput: OAn array to insert the Vector2s in to. If not provided a new array will be created.
Checks to see if the Circle is empty: has a radius of zero.
Set the color of the light from a single integer RGB value.
The integer RGB color of the light.
Sets the display origin of this Game Object. The difference between this and setting the origin is that you can use pixel values for setting the display origin.
Optionalx: numberThe horizontal display origin value. Default 0.
Optionaly: numberThe vertical display origin value. If not defined it will be set to the value of x. Default x.
Sets this Circle to be empty with a radius of zero. Does not change its position.
Set the intensity of the light.
The intensity of the light.
Sets the origin of this Game Object.
The values are given in the range 0 to 1.
Optionalx: numberThe horizontal origin value. Default 0.5.
Optionaly: numberThe vertical origin value. If not defined it will be set to the value of x. Default x.
Sets the origin of this Game Object based on the Pivot values in its Frame.
Sets the position of this Circle.
Optionalx: numberThe x position of the center of the circle. Default 0.
Optionaly: numberThe y position of the center of the circle. Default 0.
Set the radius of the light.
The radius of the light.
Sets the scroll factor of this Game Object.
The scroll factor controls the influence of the movement of a Camera upon this Game Object.
When a camera scrolls it will change the location at which this Game Object is rendered on-screen. It does not change the Game Objects actual position values.
A value of 1 means it will move exactly in sync with a camera. A value of 0 means it will not move at all, even if the camera moves. Other values control the degree to which the camera movement is mapped to this Game Object.
Please be aware that scroll factor values other than 1 are not taken in to consideration when calculating physics collisions. Bodies always collide based on their world position, but changing the scroll factor is a visual adjustment to where the textures are rendered, which can offset them from physics bodies if not accounted for in your code.
The horizontal scroll factor of this Game Object.
Optionaly: numberThe vertical scroll factor of this Game Object. If not set it will use the x value. Default x.
Sets the x, y and radius of this circle.
Optionalx: numberThe x position of the center of the circle. Default 0.
Optionaly: numberThe y position of the center of the circle. Default 0.
Optionalradius: numberThe radius of the circle. Default 0.
Sets the visibility of this Game Object.
An invisible Game Object will skip rendering, but will still process update logic.
The visible state of the Game Object.
Set the z position of the light.
The z position of the light.
Set the z position of the light as a fraction of the radius. This affects the relief effect created by the light. A higher value will make the light appear more raised. Strong values are in the range of 0 to 0.5.
The normalized z position of the light.
Updates the Display Origin cached values internally stored on this Game Object. You don't usually call this directly, but it is exposed for edge-cases where you may.
StaticAreaCalculates the area of the circle.
The Circle to get the area of.
StaticCircumferenceReturns the circumference of the given Circle.
The Circle to get the circumference of.
StaticCircumferenceReturns a Vector2 object containing the coordinates of a point on the circumference of the Circle based on the given angle.
StaticCloneStaticContainsCheck 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.
StaticContainsStaticContainsStaticCopyStaticEqualsStaticGetStaticGetReturns 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: OA Vector2 instance to store the return values in. If not given a new Vector2 object will be created.
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 falsey value the quantity will be derived from the stepRate instead.
OptionalstepRate: numberSets the quantity by getting the circumference of the circle and dividing it by the stepRate.
Optionaloutput: any[]An array to insert the points in to. If not provided a new array will be created.
StaticOffsetStaticOffsetStaticRandom
A 2D Light.
These are created by the Phaser.GameObjects.LightsManager, available from within a scene via
this.lights.Any Game Objects with the Lighting Component, and
setLighting(true), will then be affected by these Lights. If they have a normal map, it will be used. If they don't, the Lights will use the default normal map, a flat surface.They can also simply be used to represent a point light for your own purposes.
Lights cannot be added to Containers. They are designed to exist in the root of a Scene.