Phaser API Documentation

  Version: 
Filter

A 2D point light.

These are typically created by a Phaser.GameObjects.LightsManager, available from within a scene via this.lights.

Any Game Objects using the Light2D pipeline will then be affected by these Lights as long as they have a normal map.

They can also simply be used to represent a point light for your own purposes.

As of Phaser 3.60 this Game Object now has the Transform and Origin components. However, changing the scale, rotation or origin properties will not make any difference to the Light. They are simply present to allow you to add this Light to a Container, or enable it for Physics.

Constructor:

new Light(x, y, radius, r, g, b, intensity)

Parameters:

name type description
x number

The horizontal position of the light.

y number

The vertical position of the light.

radius number

The radius of the light.

r number

The red color of the light. A value between 0 and 1.

g number

The green color of the light. A value between 0 and 1.

b number

The blue color of the light. A value between 0 and 1.

intensity number

The intensity of the light.

Since: 3.0.0

Extends


Members

<static, constant> RENDER_MASK: number
Focus
Focus

Description:

The bitmask that GameObject.renderFlags is compared against to determine if the Game Object will render or not.

Type:
number
Since: 3.0.0
Focus
Focus
<private> _diameter: number
Focus
Focus

Description:

The internal diameter of the circle.

Type:
number
Inherited from: Phaser.Geom.Circle#_diameter
Since: 3.0.0
Source: src/geom/circle/Circle.js (Line 82)
Focus
Focus
<private> _originComponent: boolean
Focus
Focus

Description:

A property indicating that a Game Object has this component.

Type:
boolean
Default: true
Inherited from: Phaser.GameObjects.Components.Origin#_originComponent
Since: 3.2.0
Focus
Focus
<private> _radius: number
Focus
Focus

Description:

The internal radius of the circle.

Type:
number
Inherited from: Phaser.Geom.Circle#_radius
Since: 3.0.0
Source: src/geom/circle/Circle.js (Line 72)
Focus
Focus
<private> _rotation: number
Focus
Focus

Description:

Private internal value. Holds the rotation value in radians.

Type:
number
Default: 0
Inherited from: Phaser.GameObjects.Components.Transform#_rotation
Since: 3.0.0
Focus
Focus
<private> _scaleX: number
Focus
Focus

Description:

Private internal value. Holds the horizontal scale value.

Type:
number
Default: 1
Inherited from: Phaser.GameObjects.Components.Transform#_scaleX
Since: 3.0.0
Focus
Focus
<private> _scaleY: number
Focus
Focus

Description:

Private internal value. Holds the vertical scale value.

Type:
number
Default: 1
Inherited from: Phaser.GameObjects.Components.Transform#_scaleY
Since: 3.0.0
Focus
Focus
<private> _visible: boolean
Focus
Focus

Description:

Private internal value. Holds the visible value.

Type:
boolean
Default: true
Inherited from: Phaser.GameObjects.Components.Visible#_visible
Since: 3.0.0
Focus
Focus
angle: number
Focus
Focus

Description:

The angle of this Game Object as expressed in degrees.

Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left and -90 is up.

If you prefer to work in radians, see the rotation property instead.

Type:
number
Default: 0
Inherited from: Phaser.GameObjects.Components.Transform#angle
Since: 3.0.0
Focus
Focus
bottom: number
Focus
Focus

Description:

The bottom position of the Circle.

Type:
number
Inherited from: Phaser.Geom.Circle#bottom
Since: 3.0.0
Focus
Focus
cameraFilter: number
Focus
Focus

Description:

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:

Type:
number
Default: 0
Since: 3.0.0
Focus
Focus

Description:

The color of the light.

Type:
Since: 3.50.0
Focus
Focus
diameter: number
Focus
Focus

Description:

The diameter of the Circle.

Type:
number
Inherited from: Phaser.Geom.Circle#diameter
Since: 3.0.0
Focus
Focus
displayHeight: number
Focus
Focus

Description:

The height of this Light Game Object. This is the same as Light.diameter.

Type:
number
Since: 3.60.0
Focus
Focus
displayOriginX: number
Focus
Focus

Description:

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.

Type:
number
Inherited from: Phaser.GameObjects.Components.Origin#displayOriginX
Since: 3.0.0
Focus
Focus
displayOriginY: number
Focus
Focus

Description:

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.

Type:
number
Inherited from: Phaser.GameObjects.Components.Origin#displayOriginY
Since: 3.0.0
Focus
Focus
displayWidth: number
Focus
Focus

Description:

The width of this Light Game Object. This is the same as Light.diameter.

Type:
number
Since: 3.60.0
Focus
Focus
<readonly> hasTransformComponent: boolean
Focus
Focus

Description:

A property indicating that a Game Object has this component.

Type:
boolean
Default: true
Inherited from: Phaser.GameObjects.Components.Transform#hasTransformComponent
Since: 3.60.0
Focus
Focus
height: number
Focus
Focus

Description:

The height of this Light Game Object. This is the same as Light.diameter.

Type:
number
Since: 3.60.0
Focus
Focus
intensity: number
Focus
Focus

Description:

The intensity of the light.

Type:
number
Since: 3.50.0
Focus
Focus
left: number
Focus
Focus

Description:

The left position of the Circle.

Type:
number
Inherited from: Phaser.Geom.Circle#left
Since: 3.0.0
Focus
Focus
<readonly> originX: number
Focus
Focus

Description:

The 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().

Type:
number
Default: 0.5
Inherited from: Phaser.GameObjects.Components.Origin#originX
Since: 3.0.0
Focus
Focus
<readonly> originY: number
Focus
Focus

Description:

The 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().

Type:
number
Default: 0.5
Inherited from: Phaser.GameObjects.Components.Origin#originY
Since: 3.0.0
Focus
Focus
radius: number
Focus
Focus

Description:

The radius of the Circle.

Type:
number
Inherited from: Phaser.Geom.Circle#radius
Since: 3.0.0
Focus
Focus
renderFlags: number
Focus
Focus

Description:

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.

Type:
number
Default: 15
Since: 3.0.0
Focus
Focus
rotation: number
Focus
Focus

Description:

The angle of this Game Object in radians.

Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left and -PI/2 is up.

If you prefer to work in degrees, see the angle property instead.

Type:
number
Default: 1
Inherited from: Phaser.GameObjects.Components.Transform#rotation
Since: 3.0.0
Focus
Focus
scale: number
Focus
Focus

Description:

This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object to the same value, at the same time. When reading this value the result returned is (scaleX + scaleY) / 2.

Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this isn't the case, use the scaleX or scaleY properties instead.

Type:
number
Default: 1
Inherited from: Phaser.GameObjects.Components.Transform#scale
Since: 3.18.0
Focus
Focus
scaleX: number
Focus
Focus

Description:

The horizontal scale of this Game Object.

Type:
number
Default: 1
Inherited from: Phaser.GameObjects.Components.Transform#scaleX
Since: 3.0.0
Focus
Focus
scaleY: number
Focus
Focus

Description:

The vertical scale of this Game Object.

Type:
number
Default: 1
Inherited from: Phaser.GameObjects.Components.Transform#scaleY
Since: 3.0.0
Focus
Focus
scrollFactorX: number
Focus
Focus

Description:

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.

Type:
number
Default: 1
Inherited from: Phaser.GameObjects.Components.ScrollFactor#scrollFactorX
Since: 3.0.0
Focus
Focus
scrollFactorY: number
Focus
Focus

Description:

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.

Type:
number
Default: 1
Inherited from: Phaser.GameObjects.Components.ScrollFactor#scrollFactorY
Since: 3.0.0
Focus
Focus
top: number
Focus
Focus

Description:

The top position of the Circle.

Type:
number
Inherited from: Phaser.Geom.Circle#top
Since: 3.0.0
Focus
Focus
<readonly> type: number
Focus
Focus

Description:

The geometry constant type of this object: GEOM_CONST.CIRCLE. Used for fast type comparisons.

Type:
number
Inherited from: Phaser.Geom.Circle#type
Since: 3.19.0
Source: src/geom/circle/Circle.js (Line 41)
Focus
Focus
visible: boolean
Focus
Focus

Description:

The visible state of the Game Object.

An invisible Game Object will skip rendering, but will still process update logic.

Type:
boolean
Inherited from: Phaser.GameObjects.Components.Visible#visible
Since: 3.0.0
Focus
Focus
w: number
Focus
Focus

Description:

The w position of this Game Object.

Type:
number
Default: 0
Inherited from: Phaser.GameObjects.Components.Transform#w
Since: 3.0.0
Focus
Focus
width: number
Focus
Focus

Description:

The width of this Light Game Object. This is the same as Light.diameter.

Type:
number
Since: 3.60.0
Focus
Focus
x: number
Focus
Focus

Description:

The x position of the center of the circle.

Type:
number
Default: 0
Inherited from: Phaser.Geom.Circle#x
Overrides: Phaser.GameObjects.Components.Transform#x
Since: 3.0.0
Source: src/geom/circle/Circle.js (Line 52)
Focus
Focus
y: number
Focus
Focus

Description:

The y position of the center of the circle.

Type:
number
Default: 0
Inherited from: Phaser.Geom.Circle#y
Overrides: Phaser.GameObjects.Components.Transform#y
Since: 3.0.0
Source: src/geom/circle/Circle.js (Line 62)
Focus
Focus
z: number
Focus
Focus

Description:

The z position of this Game Object.

Note: The z position does not control the rendering order of 2D Game Objects. Use Phaser.GameObjects.Components.Depth#depth instead.

Type:
number
Default: 0
Inherited from: Phaser.GameObjects.Components.Transform#z
Since: 3.0.0
Focus
Focus

Methods

contains(x, y)
Focus
Focus

Description:

Check to see if the Circle contains the given x / y coordinates.

Parameters:

name type description
x number

The x coordinate to check within the circle.

y number

The y coordinate to check within the circle.

Returns:
Description:

True if the coordinates are within the circle, otherwise false.

Type:
  • boolean
Inherited from: Phaser.Geom.Circle#contains
Since: 3.0.0
Source: src/geom/circle/Circle.js (Line 93)
Focus
Focus
copyPosition(source)
Focus
Focus

Description:

Copies an object's coordinates to this Game Object's position.

Parameters:

name type description
source Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like

An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Transform#copyPosition
Since: 3.50.0
Focus
Focus
getLocalPoint(x, y, [point], [camera])
Focus
Focus

Description:

Takes the given x and y coordinates and converts them into local space for this Game Object, taking into account parent and local transforms, and the Display Origin.

The returned Vector2 contains the translated point in its properties.

A Camera needs to be provided in order to handle modified scroll factors. If no camera is specified, it will use the main camera from the Scene to which this Game Object belongs.

Parameters:

name type arguments description
x number

The x position to translate.

y number

The y position to translate.

point Phaser.Math.Vector2 <optional>

A Vector2, or point-like object, to store the results in.

camera Phaser.Cameras.Scene2D.Camera <optional>

The Camera which is being tested against. If not given will use the Scene default camera.

Returns:
Description:

The translated point.

Inherited from: Phaser.GameObjects.Components.Transform#getLocalPoint
Since: 3.50.0
Focus
Focus
getLocalTransformMatrix([tempMatrix])
Focus
Focus

Description:

Gets the local transform matrix for this Game Object.

Parameters:

name type arguments description
tempMatrix Phaser.GameObjects.Components.TransformMatrix <optional>

The matrix to populate with the values from this Game Object.

Returns:
Description:

The populated Transform Matrix.

Inherited from: Phaser.GameObjects.Components.Transform#getLocalTransformMatrix
Since: 3.4.0
Focus
Focus
getParentRotation()
Focus
Focus

Description:

Gets the sum total rotation of all of this Game Objects parent Containers.

The returned value is in radians and will be zero if this Game Object has no parent container.

Returns:
Description:

The sum total rotation, in radians, of all parent containers of this Game Object.

Type:
  • number
Inherited from: Phaser.GameObjects.Components.Transform#getParentRotation
Since: 3.18.0
Focus
Focus
getPoint(position, [out])
Focus
Focus

Description:

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.

Parameters:

name type arguments description
position number

A value between 0 and 1, where 0 equals 0 degrees, 0.5 equals 180 degrees and 1 equals 360 around the circle.

out object | Phaser.Geom.Point <optional>

An object to store the return values in. If not given a Point object will be created.

Returns:
Description:

A Point, or point-like object, containing the coordinates of the point around the circle.

Type:
Inherited from: Phaser.Geom.Circle#getPoint
Since: 3.0.0
Focus
Focus
getPoints(quantity, [stepRate], [output])
Focus
Focus

Description:

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.

Parameters:

name type arguments description
quantity number

The amount of points to return. If a falsey value the quantity will be derived from the stepRate instead.

stepRate number <optional>

Sets the quantity by getting the circumference of the circle and dividing it by the stepRate.

output array | Array.<Phaser.Geom.Point> <optional>

An array to insert the points in to. If not provided a new array will be created.

Returns:
Description:

An array of Point objects pertaining to the points around the circumference of the circle.

Type:
Inherited from: Phaser.Geom.Circle#getPoints
Since: 3.0.0
Focus
Focus
getRandomPoint([point])
Focus
Focus

Description:

Returns a uniformly distributed random point from anywhere within the Circle.

Parameters:

name type arguments description
point object | Phaser.Geom.Point <optional>

A Point or point-like object to set the random x and y values in.

Returns:
Description:

A Point object with the random values set in the x and y properties.

Type:
Inherited from: Phaser.Geom.Circle#getRandomPoint
Since: 3.0.0
Focus
Focus
getWorldTransformMatrix([tempMatrix], [parentMatrix])
Focus
Focus

Description:

Gets the world transform matrix for this Game Object, factoring in any parent Containers.

Parameters:

name type arguments description
tempMatrix Phaser.GameObjects.Components.TransformMatrix <optional>

The matrix to populate with the values from this Game Object.

parentMatrix Phaser.GameObjects.Components.TransformMatrix <optional>

A temporary matrix to hold parent values during the calculations.

Returns:
Description:

The populated Transform Matrix.

Inherited from: Phaser.GameObjects.Components.Transform#getWorldTransformMatrix
Since: 3.4.0
Focus
Focus
isEmpty()
Focus
Focus

Description:

Checks to see if the Circle is empty: has a radius of zero.

Returns:
Description:

True if the Circle is empty, otherwise false.

Type:
  • boolean
Inherited from: Phaser.Geom.Circle#isEmpty
Since: 3.0.0
Focus
Focus
setAngle([degrees])
Focus
Focus

Description:

Sets the angle of this Game Object.

Parameters:

name type arguments description
degrees number <optional>

The rotation of this Game Object, in degrees.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Transform#setAngle
Since: 3.0.0
Focus
Focus
setColor(rgb)
Focus
Focus

Description:

Set the color of the light from a single integer RGB value.

Parameters:

name type description
rgb number

The integer RGB color of the light.

Returns:
Description:

This Light object.

Since: 3.0.0
Focus
Focus
setDisplayOrigin([x], [y])
Focus
Focus

Description:

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.

Parameters:

name type arguments Default description
x number <optional> 0

The horizontal display origin value.

y number <optional> x

The vertical display origin value. If not defined it will be set to the value of x.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Origin#setDisplayOrigin
Since: 3.0.0
Focus
Focus
setEmpty()
Focus
Focus

Description:

Sets this Circle to be empty with a radius of zero. Does not change its position.

Returns:
Description:

This Circle object.

Inherited from: Phaser.Geom.Circle#setEmpty
Since: 3.0.0
Focus
Focus
setIntensity(intensity)
Focus
Focus

Description:

Set the intensity of the light.

Parameters:

name type description
intensity number

The intensity of the light.

Returns:
Description:

This Light object.

Since: 3.0.0
Focus
Focus
setOrigin([x], [y])
Focus
Focus

Description:

Sets the origin of this Game Object.

The values are given in the range 0 to 1.

Parameters:

name type arguments Default description
x number <optional> 0.5

The horizontal origin value.

y number <optional> x

The vertical origin value. If not defined it will be set to the value of x.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Origin#setOrigin
Since: 3.0.0
Focus
Focus
setOriginFromFrame()
Focus
Focus

Description:

Sets the origin of this Game Object based on the Pivot values in its Frame.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Origin#setOriginFromFrame
Since: 3.0.0
Focus
Focus
setPosition([x], [y])
Focus
Focus

Description:

Sets the position of this Circle.

Parameters:

name type arguments description
x number <optional>

The x position of the center of the circle.

y number <optional>

The y position of the center of the circle.

Returns:
Description:

This Circle object.

Inherited from: Phaser.Geom.Circle#setPosition
Overrides: Phaser.GameObjects.Components.Transform#setPosition
Since: 3.0.0
Focus
Focus
setRadius(radius)
Focus
Focus

Description:

Set the radius of the light.

Parameters:

name type description
radius number

The radius of the light.

Returns:
Description:

This Light object.

Since: 3.0.0
Focus
Focus
setRandomPosition([x], [y], [width], [height])
Focus
Focus

Description:

Sets the position of this Game Object to be a random position within the confines of the given area.

If no area is specified a random position between 0 x 0 and the game width x height is used instead.

The position does not factor in the size of this Game Object, meaning that only the origin is guaranteed to be within the area.

Parameters:

name type arguments description
x number <optional>

The x position of the top-left of the random area.

y number <optional>

The y position of the top-left of the random area.

width number <optional>

The width of the random area.

height number <optional>

The height of the random area.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Transform#setRandomPosition
Since: 3.8.0
Focus
Focus
setRotation([radians])
Focus
Focus

Description:

Sets the rotation of this Game Object.

Parameters:

name type arguments description
radians number <optional>

The rotation of this Game Object, in radians.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Transform#setRotation
Since: 3.0.0
Focus
Focus
setScale([x], [y])
Focus
Focus

Description:

Sets the scale of this Game Object.

Parameters:

name type arguments Default description
x number <optional> 1

The horizontal scale of this Game Object.

y number <optional> x

The vertical scale of this Game Object. If not set it will use the x value.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Transform#setScale
Since: 3.0.0
Focus
Focus
setScrollFactor(x, [y])
Focus
Focus

Description:

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.

Parameters:

name type arguments Default description
x number

The horizontal scroll factor of this Game Object.

y number <optional> x

The vertical scroll factor of this Game Object. If not set it will use the x value.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.ScrollFactor#setScrollFactor
Since: 3.0.0
Focus
Focus
setTo([x], [y], [radius])
Focus
Focus

Description:

Sets the x, y and radius of this circle.

Parameters:

name type arguments description
x number <optional>

The x position of the center of the circle.

y number <optional>

The y position of the center of the circle.

radius number <optional>

The radius of the circle.

Returns:
Description:

This Circle object.

Inherited from: Phaser.Geom.Circle#setTo
Since: 3.0.0
Focus
Focus
setVisible(value)
Focus
Focus

Description:

Sets the visibility of this Game Object.

An invisible Game Object will skip rendering, but will still process update logic.

Parameters:

name type description
value boolean

The visible state of the Game Object.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Visible#setVisible
Since: 3.0.0
Focus
Focus
setW([value])
Focus
Focus

Description:

Sets the w position of this Game Object.

Parameters:

name type arguments description
value number <optional>

The w position of this Game Object.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Transform#setW
Since: 3.0.0
Focus
Focus
setX([value])
Focus
Focus

Description:

Sets the x position of this Game Object.

Parameters:

name type arguments description
value number <optional>

The x position of this Game Object.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Transform#setX
Since: 3.0.0
Focus
Focus
setY([value])
Focus
Focus

Description:

Sets the y position of this Game Object.

Parameters:

name type arguments description
value number <optional>

The y position of this Game Object.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Transform#setY
Since: 3.0.0
Focus
Focus
setZ([value])
Focus
Focus

Description:

Sets the z position of this Game Object.

Note: The z position does not control the rendering order of 2D Game Objects. Use Phaser.GameObjects.Components.Depth#setDepth instead.

Parameters:

name type arguments description
value number <optional>

The z position of this Game Object.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Transform#setZ
Since: 3.0.0
Focus
Focus
updateDisplayOrigin()
Focus
Focus

Description:

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.

Returns:
Description:

This Game Object instance.

Inherited from: Phaser.GameObjects.Components.Origin#updateDisplayOrigin
Since: 3.0.0
Focus
Focus
willRender(camera)
Focus
Focus

Description:

Compares the renderMask with the renderFlags to see if this Game Object will render or not. Also checks the Game Object against the given Cameras exclusion list.

Parameters:

name type description
camera Phaser.Cameras.Scene2D.Camera

The Camera to check against this Game Object.

Returns:
Description:

True if the Game Object should be rendered, otherwise false.

Type:
  • boolean
Since: 3.50.0
Focus
Focus