The alpha value of the Game Object.
This is a global value, impacting the entire Game Object, not just a region of it.
The alpha value starting from the bottom-left of the Game Object. This value is interpolated from the corner to the center of the Game Object.
The alpha value starting from the bottom-right of the Game Object. This value is interpolated from the corner to the center of the Game Object.
The alpha value starting from the top-left of the Game Object. This value is interpolated from the corner to the center of the Game Object.
The alpha value starting from the top-right of the Game Object. This value is interpolated from the corner to the center of the Game Object.
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.
OptionalanimsThe string-based key of the animation to play, or an Animation instance, or a PlayAnimationConfig object.
Sets the Blend Mode being used by this Game Object.
This can be a const, such as Phaser.BlendModes.SCREEN, or an integer, such as 4 (for Overlay)
Under WebGL only the following Blend Modes are available:
Canvas has more available depending on browser support.
You can also create your own custom Blend Modes in WebGL.
Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these reasons try to be careful about the construction of your Scene and the frequency of which blend modes are used.
Customized WebGL render nodes of this Game Object. RenderNodes are responsible for managing the rendering process of this Game Object. A default set of RenderNodes are coded into the engine, but they will check here first to see if a custom one exists.
The default RenderNodes for this Game Object. RenderNodes are responsible for managing the rendering process of this Game Object. These are the nodes that are used if no custom ones are set.
RenderNodes are identified by a unique key for their role.
Common role keys include:
The depth of this Game Object within the Scene. Ensure this value is only ever set to a number data-type.
The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order of Game Objects, without actually moving their position in the display list.
The default depth is zero. A Game Object with a higher depth value will always render in front of one with a lower value.
Setting the depth will queue a depth sort event within the Scene.
The displayed height of this Game Object.
This value takes into account the scale factor.
Setting this value will adjust the Game Object's scale property.
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 displayed width of this Game Object.
This value takes into account the scale factor.
Setting this value will adjust the Game Object's scale property.
The horizontally flipped state of the Game Object.
A Game Object that is flipped horizontally will render inversed on the horizontal axis. Flipping always takes place from the middle of the texture and does not impact the scale value. If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.
The vertically flipped state of the Game Object.
A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) Flipping always takes place from the middle of the texture and does not impact the scale value. If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.
ReadonlyhasA property indicating that a Game Object has this component.
The native (un-scaled) height of this Game Object.
Changing this value will not change the size that the Game Object is rendered in-game.
For that you need to either set the scale of the Game Object (setScale) or use
the displayHeight property.
A boolean flag indicating if this Game Object is being cropped or not.
You can toggle this at any time after setCrop has been called, to turn cropping on or off.
Equally, calling setCrop with no arguments will reset the crop and disable it.
ReadonlyisDoes this Game Object have a tint applied?
It checks to see if the 4 tint properties are set to the value 0xffffff
and that the tintFill property is false. This indicates that a Game Object isn't tinted.
OptionalkeyThe key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager.
The Mask this Game Object is using during render.
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().
An object to store render node specific data in, to be read by the render nodes this Game Object uses.
Render nodes store their data under their own name, not their role.
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.
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.
The horizontal scale of this Game Object.
The vertical scale of this Game Object.
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 tint value being applied to the whole of the Game Object.
Return tintTopLeft when read this tint property.
The tint value being applied to the bottom-left vertice of the Game Object. This value is interpolated from the corner to the center of the Game Object. The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple.
The tint value being applied to the bottom-right vertice of the Game Object. This value is interpolated from the corner to the center of the Game Object. The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple.
The tint fill mode.
false = An additive tint (the default), where vertices colors are blended with the texture.
true = A fill tint, where the vertices colors replace the texture, but respects texture alpha.
The tint value being applied to the top-left vertice of the Game Object. This value is interpolated from the corner to the center of the Game Object. The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple.
The tint value being applied to the top-right vertice of the Game Object. This value is interpolated from the corner to the center of the Game Object. The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple.
OptionalcallbackScope?: anyThe scope (or context) for all of the callbacks. The default scope is the tween.
OptionalcompleteDelay?: string | number | object | Function | any[]The time the tween will wait before the onComplete event is dispatched once it has completed, in ms.
Optionaldelay?: number | FunctionThe number of milliseconds to delay before the tween will start.
Optionalduration?: numberThe duration of the tween in milliseconds.
Optionalease?: string | FunctionThe easing equation to use for the tween.
OptionaleaseParams?: any[]Optional easing parameters.
OptionalflipX?: booleanHorizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the flipX property.
OptionalflipY?: booleanVertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the flipY property.
Optionalhold?: numberThe number of milliseconds to hold the tween for before yoyo'ing.
Optionalinterpolation?: string | FunctionThe interpolation function to use if the value given is an array of numbers.
Optionalloop?: string | number | object | Function | any[]The number of times the tween will repeat. (A value of 1 means the tween will play twice, as it repeated once.) The first loop starts after every property in the tween has completed once.
OptionalloopDelay?: string | number | object | Function | any[]The time the tween will pause before starting either a yoyo or returning to the start for a repeat.
OptionalonActive?: TweenOnActiveCallbackA function to call when the tween becomes active within the Tween Manager.
OptionalonActiveParams?: any[]Additional parameters to pass to onActive.
OptionalonComplete?: TweenOnCompleteCallbackA function to call when the tween completes.
OptionalonCompleteParams?: any[]Additional parameters to pass to onComplete.
OptionalonLoop?: TweenOnLoopCallbackA function to call each time the tween loops.
OptionalonLoopParams?: any[]Additional parameters to pass to onLoop.
OptionalonPause?: TweenOnPauseCallbackA function to call when the tween is paused.
OptionalonPauseParams?: any[]Additional parameters to pass to onPause.
OptionalonRepeat?: TweenOnRepeatCallbackA function to call each time a property tween repeats. Called once per property per target.
OptionalonRepeatParams?: any[]Additional parameters to pass to onRepeat.
OptionalonResume?: TweenOnResumeCallbackA function to call when the tween is resumed after being paused.
OptionalonResumeParams?: any[]Additional parameters to pass to onResume.
OptionalonStart?: TweenOnStartCallbackA function to call when the tween starts playback, after any delays have expired.
OptionalonStartParams?: any[]Additional parameters to pass to onStart.
OptionalonStop?: TweenOnStopCallbackA function to call when the tween is stopped.
OptionalonStopParams?: any[]Additional parameters to pass to onStop.
OptionalonUpdate?: TweenOnUpdateCallbackA function to call each time the tween steps. Called once per property per target.
OptionalonUpdateParams?: any[]Additional parameters to pass to onUpdate.
OptionalonYoyo?: TweenOnYoyoCallbackA function to call each time a property tween yoyos. Called once per property per target.
OptionalonYoyoParams?: any[]Additional parameters to pass to onYoyo.
Optionalpaused?: booleanDoes the tween start in a paused state (true) or playing (false)?
Optionalpersist?: booleanWill the Tween be automatically destroyed on completion, or retained for future playback?
Optionalprops?: { [key: string]: string | number | GetEndCallback | TweenPropConfig }The properties to tween.
Optionalrepeat?: numberThe number of times each property tween repeats.
OptionalrepeatDelay?: numberThe number of milliseconds to pause before a repeat.
Optionalyoyo?: booleanShould the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take duration milliseconds to complete.
OptionalcallbackScope?: anyThe scope (or context) for all of the callbacks. The default scope is the tween.
OptionalcompleteDelay?: string | number | object | Function | any[]The time the tween will wait before the onComplete event is dispatched once it has completed, in ms.
Optionaldelay?: number | FunctionThe number of milliseconds to delay before the tween will start.
Optionalduration?: numberThe duration of the tween in milliseconds.
Optionalease?: string | FunctionThe easing equation to use for the tween.
OptionaleaseParams?: any[]Optional easing parameters.
OptionalflipX?: booleanHorizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the flipX property.
OptionalflipY?: booleanVertically flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the flipY property.
Optionalhold?: numberThe number of milliseconds to hold the tween for before yoyo'ing.
Optionalinterpolation?: string | FunctionThe interpolation function to use if the value given is an array of numbers.
Optionalloop?: string | number | object | Function | any[]The number of times the tween will repeat. (A value of 1 means the tween will play twice, as it repeated once.) The first loop starts after every property in the tween has completed once.
OptionalloopDelay?: string | number | object | Function | any[]The time the tween will pause before starting either a yoyo or returning to the start for a repeat.
OptionalonActive?: TweenOnActiveCallbackA function to call when the tween becomes active within the Tween Manager.
OptionalonActiveParams?: any[]Additional parameters to pass to onActive.
OptionalonComplete?: TweenOnCompleteCallbackA function to call when the tween completes.
OptionalonCompleteParams?: any[]Additional parameters to pass to onComplete.
OptionalonLoop?: TweenOnLoopCallbackA function to call each time the tween loops.
OptionalonLoopParams?: any[]Additional parameters to pass to onLoop.
OptionalonPause?: TweenOnPauseCallbackA function to call when the tween is paused.
OptionalonPauseParams?: any[]Additional parameters to pass to onPause.
OptionalonRepeat?: TweenOnRepeatCallbackA function to call each time a property tween repeats. Called once per property per target.
OptionalonRepeatParams?: any[]Additional parameters to pass to onRepeat.
OptionalonResume?: TweenOnResumeCallbackA function to call when the tween is resumed after being paused.
OptionalonResumeParams?: any[]Additional parameters to pass to onResume.
OptionalonStart?: TweenOnStartCallbackA function to call when the tween starts playback, after any delays have expired.
OptionalonStartParams?: any[]Additional parameters to pass to onStart.
OptionalonStop?: TweenOnStopCallbackA function to call when the tween is stopped.
OptionalonStopParams?: any[]Additional parameters to pass to onStop.
OptionalonUpdate?: TweenOnUpdateCallbackA function to call each time the tween steps. Called once per property per target.
OptionalonUpdateParams?: any[]Additional parameters to pass to onUpdate.
OptionalonYoyo?: TweenOnYoyoCallbackA function to call each time a property tween yoyos. Called once per property per target.
OptionalonYoyoParams?: any[]Additional parameters to pass to onYoyo.
Optionalpaused?: booleanDoes the tween start in a paused state (true) or playing (false)?
Optionalpersist?: booleanWill the Tween be automatically destroyed on completion, or retained for future playback?
Optionalprops?: { [key: string]: string | number | GetEndCallback | TweenPropConfig }The properties to tween.
Optionalrepeat?: numberThe number of times each property tween repeats.
OptionalrepeatDelay?: numberThe number of milliseconds to pause before a repeat.
Optionalyoyo?: booleanShould the tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take duration milliseconds to complete.
OptionaluseThis property is used exclusively by Tilemap.createFromTiles. Set to true if this Sprite is being created by a Tilemap and is part of a spritesheet.
The visible state of the Game Object.
An invisible Game Object will skip rendering, but will still process update logic.
The w position of this Game Object.
The native (un-scaled) width of this Game Object.
Changing this value will not change the size that the Game Object is rendered in-game.
For that you need to either set the scale of the Game Object (setScale) or use
the displayWidth property.
The x position of this Game Object.
The y position of this Game Object.
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.
The active state of this Game Object. A Game Object with an active state of
trueis processed by the Scenes UpdateList, if added to it. An active object is one which is having its logic and internal systems updated.