Skip to main content
Version: Phaser v4.0.0

GameObjectCreator

The Game Object Creator is a Scene plugin that allows you to quickly create many common types of Game Objects and return them using a configuration object, rather than having to specify individual parameters as required by the GameObjectFactory.

Game Objects made via this class are automatically added to the Scene and Update List unless you explicitly set the add property in the configuration object to false.

Constructor

new GameObjectCreator(scene)

Parameters

nametypeoptionaldescription
scenePhaser.SceneNoThe Scene to which this Game Object Creator belongs.

Scope: static

Source: src/gameobjects/GameObjectCreator.js#L11
Since: 3.0.0

Public Members

displayList

displayList: Phaser.GameObjects.DisplayList

Description:

A reference to the Scene Display List.

Access: protected

Source: src/gameobjects/GameObjectCreator.js#L63
Since: 3.0.0


events

events: Phaser.Events.EventEmitter

Description:

A reference to the Scene Event Emitter.

Access: protected

Source: src/gameobjects/GameObjectCreator.js#L53
Since: 3.50.0


scene

scene: Phaser.Scene

Description:

The Scene to which this Game Object Creator belongs.

Access: protected

Source: src/gameobjects/GameObjectCreator.js#L33
Since: 3.0.0


systems

systems: Phaser.Scenes.Systems

Description:

A reference to the Scene.Systems.

Access: protected

Source: src/gameobjects/GameObjectCreator.js#L43
Since: 3.0.0


updateList

updateList: Phaser.GameObjects.UpdateList

Description:

A reference to the Scene Update List.

Access: protected

Source: src/gameobjects/GameObjectCreator.js#L73
Since: 3.0.0


Public Methods

bitmapText

<instance> bitmapText(config, [addToScene])

Description:

Creates a new Bitmap Text Game Object and returns it.

BitmapText objects work by taking a pre-rendered font texture and then stamping out each character of the text from that texture. This makes rendering very fast compared to using a Canvas-based font, but it means the font must be created in advance and stored as a texture atlas. Use this method via scene.make.bitmapText() when you need high-performance static text rendering in your game.

Note: This method will only be available if the Bitmap Text Game Object has been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.BitmapText.BitmapTextConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.BitmapText - The Game Object that was created.

Source: src/gameobjects/bitmaptext/static/BitmapTextCreator.js#L13
Since: 3.0.0


blitter

<instance> blitter(config, [addToScene])

Description:

Creates a new Blitter Game Object and returns it.

A Blitter is a highly efficient Game Object for rendering large numbers of Bob objects, all of which share the same texture. Unlike using individual Game Objects, a Blitter batches all of its Bobs into a single draw call, making it ideal for particle-like effects, crowds, bullet pools, or any scenario where you need many instances of the same image rendered with minimal overhead.

Note: This method will only be available if the Blitter Game Object has been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.Sprite.SpriteConfigNoThe configuration object this Game Object will use to create itself. The key property identifies the texture to use, and the optional frame property identifies a specific frame within that texture.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.Blitter - The Game Object that was created.

Source: src/gameobjects/blitter/BlitterCreator.js#L12
Since: 3.0.0


captureFrame

<instance> captureFrame(config, [addToScene])

Description:

Creates a new CaptureFrame Game Object and returns it.

A CaptureFrame is a special Game Object that captures the current state of the WebGL framebuffer at the point it is rendered in the display list. Objects rendered before it are captured to a named texture; objects rendered after it are not. This is useful for full-scene post-processing effects such as a layer of water or a distortion overlay. The captured texture can then be referenced by key and used on other Game Objects or filters.

This is a WebGL-only feature and has no effect in Canvas mode. The Camera must have forceComposite enabled, or the CaptureFrame must be used within a framebuffer context (such as a Filter, DynamicTexture, or a Camera with alpha between 0 and 1).

Note: This method will only be available if the CaptureFrame Game Object has been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.GameObjectConfigNoThe configuration object this Game Object will use to create itself. CaptureFrame only uses the key, visible, depth, and add properties.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.CaptureFrame - The Game Object that was created.

Source: src/gameobjects/captureframe/CaptureFrameCreator.js#L11
Since: 4.0.0


container

<instance> container(config, [addToScene])

Description:

Creates a new Container Game Object and returns it.

Note: This method will only be available if the Container Game Object has been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.Container.ContainerConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.Container - The Game Object that was created.

Source: src/gameobjects/container/ContainerCreator.js#L14
Since: 3.4.0


dynamicBitmapText

<instance> dynamicBitmapText(config, [addToScene])

Description:

Creates a new Dynamic Bitmap Text Game Object and returns it.

Note: This method will only be available if the Dynamic Bitmap Text Game Object has been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.BitmapText.BitmapTextConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.DynamicBitmapText - The Game Object that was created.

Source: src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextCreator.js#L12
Since: 3.0.0


gradient

<instance> gradient(config, [addToScene])

Description:

Creates a new Gradient Game Object and returns it. A Gradient is a rectangular Game Object that renders a smooth color gradient across its surface using WebGL. It is useful for backgrounds, overlays, and decorative visual effects where a multi-color fill is needed without a texture. Position, size, and gradient appearance are all configured via the config object.

Note: This method will only be available if the Gradient Game Object and WebGL support have been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.Gradient.GradientConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.Gradient - The Game Object that was created.

Source: src/gameobjects/gradient/GradientCreator.js#L12
Since: 4.0.0


graphics

<instance> graphics([config], [addToScene])

Description:

Creates a new Graphics Game Object and returns it.

Note: This method will only be available if the Graphics Game Object has been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.Graphics.OptionsYesThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.Graphics - The Game Object that was created.

Source: src/gameobjects/graphics/GraphicsCreator.js#L10
Since: 3.0.0


group

<instance> group(config)

Description:

Creates a new Group Game Object and returns it.

Note: This method will only be available if the Group Game Object has been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.Group.GroupConfig | Phaser.Types.GameObjects.Group.GroupCreateConfigNoThe configuration object this Game Object will use to create itself.

Returns: Phaser.GameObjects.Group - The Game Object that was created.

Source: src/gameobjects/group/GroupCreator.js#L10
Since: 3.0.0


image

<instance> image(config, [addToScene])

Description:

Creates a new Image Game Object and returns it.

Note: This method will only be available if the Image Game Object has been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.GameObjectConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.Image - The Game Object that was created.

Source: src/gameobjects/image/ImageCreator.js#L12
Since: 3.0.0


layer

<instance> layer(config, [addToScene])

Description:

Creates a new Layer Game Object and returns it.

A Layer is a special type of Game Object that groups other Game Objects together. Unlike a Container, a Layer does not apply any transform to its children. Instead, it provides a way to manage rendering order and apply post-pipelines or effects to a collection of Game Objects as a single unit. The children property of the config object can be used to pass an array of Game Objects to add to the Layer immediately upon creation.

Note: This method will only be available if the Layer Game Object has been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.Sprite.SpriteConfigNoThe configuration object this Game Object will use to create itself. The children key can be set to an array of Game Objects to add to the Layer.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.Layer - The Game Object that was created.

Source: src/gameobjects/layer/LayerCreator.js#L12
Since: 3.50.0


nineslice

<instance> nineslice(config, [addToScene])

Description:

Creates a new Nine Slice Game Object and returns it.

Note: This method will only be available if the Nine Slice Game Object and WebGL support have been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.NineSlice.NineSliceConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.NineSlice - The Game Object that was created.

Source: src/gameobjects/nineslice/NineSliceCreator.js#L13
Since: 3.60.0


noise

<instance> noise(config, [addToScene])

Description:

Creates a new Noise Game Object and returns it.

A Noise Game Object renders procedural noise — such as Perlin or simplex noise — directly onto a WebGL quad using a shader. It is useful for generating dynamic visual effects such as clouds, fog, terrain previews, animated backgrounds, or any effect that benefits from smooth, organic-looking randomness. The noise pattern is generated entirely on the GPU, making it very efficient to animate each frame.

Note: This method will only be available if the Noise Game Object and WebGL support have been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.Noise.NoiseConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.Noise - The Game Object that was created.

Source: src/gameobjects/noise/NoiseCreator.js#L12
Since: 4.0.0


noisecell2d

<instance> noisecell2d(config, [addToScene])

Description:

Creates a new NoiseCell2D Game Object and returns it.

Note: This method will only be available if the NoiseCell2D Game Object and WebGL support have been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.NoiseCell2D.NoiseCell2DConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.NoiseCell2D - The Game Object that was created.

Source: src/gameobjects/noise/noisecell2d/NoiseCell2DCreator.js#L12
Since: 4.0.0


noisecell3d

<instance> noisecell3d(config, [addToScene])

Description:

Creates a new NoiseCell3D Game Object and returns it.

Note: This method will only be available if the NoiseCell3D Game Object and WebGL support have been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.NoiseCell3D.NoiseCell3DConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.NoiseCell3D - The Game Object that was created.

Source: src/gameobjects/noise/noisecell3d/NoiseCell3DCreator.js#L12
Since: 4.0.0


noisecell4d

<instance> noisecell4d(config, [addToScene])

Description:

Creates a new NoiseCell4D Game Object and returns it.

Note: This method will only be available if the NoiseCell4D Game Object and WebGL support have been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.NoiseCell4D.NoiseCell4DConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.NoiseCell4D - The Game Object that was created.

Source: src/gameobjects/noise/noisecell4d/NoiseCell4DCreator.js#L12
Since: 4.0.0


noisesimplex2d

<instance> noisesimplex2d(config, [addToScene])

Description:

Creates a new NoiseSimplex2D Game Object and returns it.

Note: This method will only be available if the NoiseSimplex2D Game Object and WebGL support have been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.NoiseSimplex2D.NoiseSimplex2DConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.NoiseSimplex2D - The Game Object that was created.

Source: src/gameobjects/noise/noisesimplex2d/NoiseSimplex2DCreator.js#L12
Since: 4.0.0


noisesimplex3d

<instance> noisesimplex3d(config, [addToScene])

Description:

Creates a new NoiseSimplex3D Game Object and returns it.

Note: This method will only be available if the NoiseSimplex3D Game Object and WebGL support have been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.NoiseSimplex3D.NoiseSimplex3DConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.NoiseSimplex3D - The Game Object that was created.

Source: src/gameobjects/noise/noisesimplex3d/NoiseSimplex3DCreator.js#L12
Since: 4.0.0


particles

<instance> particles(config, [addToScene])

Description:

Creates a new Particle Emitter Game Object and returns it.

A Particle Emitter is a Game Object that produces a stream of particles based on a configuration object. It can be used to create effects such as explosions, fire, smoke, rain, or any other particle-based visual. The emitter is added to the Scene and managed as a standard Game Object, supporting transforms, depth, and other common properties.

Prior to Phaser v3.60 this function would create a ParticleEmitterManager. These were removed in v3.60 and replaced with creating a ParticleEmitter instance directly. Please see the updated function parameters and class documentation for more details.

Note: This method will only be available if the Particles Game Object has been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.Particles.ParticleEmitterCreatorConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.Particles.ParticleEmitter - The Game Object that was created.

Source: src/gameobjects/particles/ParticleEmitterCreator.js#L13
Since: 3.0.0


pointlight

<instance> pointlight(config, [addToScene])

Description:

Creates a new Point Light Game Object and returns it.

Note: This method will only be available if the Point Light Game Object has been built into Phaser.

Parameters:

nametypeoptionaldescription
configobjectNoThe configuration object this Game Object will use to create itself. Supported properties include color (hex color of the light, default 0xffffff), radius (radius of the light in pixels, default 128), intensity (brightness of the light, default 1), and attenuation (rate at which the light falls off toward the edges, default 0.1).
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.PointLight - The Game Object that was created.

Source: src/gameobjects/pointlight/PointLightCreator.js#L12
Since: 3.50.0


register

<static> register(factoryType, factoryFunction)

Description:

Registers a Game Object creator function on the GameObjectCreator prototype, making it available for creating Game Objects via the Scene's make property.

Parameters:

nametypeoptionaldescription
factoryTypestringNoThe key of the factory that you will use to call the Phaser.Scene.make[ factoryType ] method.
factoryFunctionfunctionNoThe constructor function to be called when you invoke the Phaser.Scene.make method.

Source: src/gameobjects/GameObjectCreator.js#L154
Since: 3.0.0


remove

<static> remove(factoryType)

Description:

Removes a previously registered custom Game Object Creator from the GameObjectCreator prototype, making it no longer available via the Scene's make property.

With this method you can remove a custom Game Object Creator that has been previously registered in the Game Object Creator. Pass in its factoryType in order to remove it.

Parameters:

nametypeoptionaldescription
factoryTypestringNoThe key of the factory that you want to remove from the GameObjectCreator.

Source: src/gameobjects/GameObjectCreator.js#L173
Since: 3.0.0


renderTexture

<instance> renderTexture(config, [addToScene])

Description:

Creates a new Render Texture Game Object and returns it.

Note: This method will only be available if the Render Texture Game Object has been built into Phaser.

A Render Texture is a combination of Dynamic Texture and an Image Game Object, that uses the Dynamic Texture to display itself with.

A Dynamic Texture is a special texture that allows you to draw textures, frames and most kind of Game Objects directly to it.

You can take many complex objects and draw them to this one texture, which can then be used as the base texture for other Game Objects, such as Sprites. Should you then update this texture, all Game Objects using it will instantly be updated as well, reflecting the changes immediately.

It's a powerful way to generate dynamic textures at run-time that are WebGL friendly and don't invoke expensive GPU uploads on each change.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.RenderTexture.RenderTextureConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.RenderTexture - The Game Object that was created.

Source: src/gameobjects/rendertexture/RenderTextureCreator.js#L12
Since: 3.2.0


rope

<instance> rope(config, [addToScene])

Description:

Creates a new Rope Game Object and returns it.

A Rope is a WebGL-only Game Object that renders a strip of textured triangles along a series of points. This makes it ideal for creating rope, ribbon, cloth, or other flexible strip-like visual effects. The points define the spine of the rope, and the texture is stretched and mapped across the resulting mesh. Per-vertex colors and alpha values can be set to create gradient or fade effects along the length of the rope.

Note: This method will only be available if the Rope Game Object and WebGL support have been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.Rope.RopeConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.Rope - The Game Object that was created.

Source: src/gameobjects/rope/RopeCreator.js#L13
Since: 3.23.0


shader

<instance> shader(config, [addToScene])

Description:

Creates a new Shader Game Object and returns it.

Note: This method will only be available if the Shader Game Object and WebGL support have been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.Shader.ShaderConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.Shader - The Game Object that was created.

Source: src/gameobjects/shader/ShaderCreator.js#L12
Since: 3.17.0


sprite

<instance> sprite(config, [addToScene])

Description:

Creates a new Sprite Game Object and returns it.

Note: This method will only be available if the Sprite Game Object has been built into Phaser.

Parameters:

nametypeoptionaldefaultdescription
configPhaser.Types.GameObjects.Sprite.SpriteConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYestrueAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.Sprite - The Game Object that was created.

Source: src/gameobjects/sprite/SpriteCreator.js#L13
Since: 3.0.0


spriteGPULayer

<instance> spriteGPULayer(config, [addToScene])

Description:

Creates a new SpriteGPULayer Game Object and returns it.

Note: This method will only be available if the SpriteGPULayer Game Object has been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.SpriteGPULayer.SpriteGPULayerConfigNoThe configuration object this Game Object will use to create itself. The size property sets the maximum number of sprites the layer can hold, and defaults to 1 if not specified.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.SpriteGPULayer - The Game Object that was created.

Source: src/gameobjects/spritegpulayer/SpriteGPULayerCreator.js#L12
Since: 4.0.0


stamp

<instance> stamp(config, [addToScene])

Description:

Creates a new Stamp Game Object and returns it.

Note: This method will only be available if the Stamp Game Object has been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.Sprite.SpriteConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.Stamp - The Game Object that was created.

Source: src/gameobjects/stamp/StampCreator.js#L12
Since: 4.0.0


text

<instance> text(config, [addToScene])

Description:

Creates a new Text Game Object and returns it.

A Text Game Object renders a string of text to an internal Canvas texture, which is then used as the source for rendering to the game canvas. It supports a wide range of styling options including font family, size, weight, fill color, stroke, drop shadow, text alignment, word wrapping, padding, fixed dimensions, and right-to-left rendering. The text content and style can be updated at any time after creation.

Unlike the factory method (scene.add.text), this creator method returns the Text Game Object without automatically adding it to the Scene's display list. Use the add property in the config object, or pass true as the addToScene argument, to add it to the Scene.

Note: This method will only be available if the Text Game Object has been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.Text.TextConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.Text - The Game Object that was created.

Source: src/gameobjects/text/TextCreator.js#L12
Since: 3.0.0


tilemap

<instance> tilemap([config])

Description:

Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. When loading from CSV or a 2D array, you should specify the tileWidth & tileHeight. When parsing from a map from Tiled, the tileWidth, tileHeight, width & height will be pulled from the map data. For an empty map, you should specify tileWidth, tileHeight, width & height.

Parameters:

nametypeoptionaldescription
configPhaser.Types.Tilemaps.TilemapConfigYesThe config options for the Tilemap.

Returns: Phaser.Tilemaps.Tilemap -

Source: src/tilemaps/TilemapCreator.js#L10
Since: 3.0.0


tileSprite

<instance> tileSprite(config, [addToScene])

Description:

Creates a new TileSprite Game Object and returns it.

Note: This method will only be available if the TileSprite Game Object has been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.TileSprite.TileSpriteConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.TileSprite - The Game Object that was created.

Source: src/gameobjects/tilesprite/TileSpriteCreator.js#L12
Since: 3.0.0


tween

<instance> tween(config)

Description:

Creates a new Tween object and returns it.

Note: This method will only be available if Tweens have been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.Tweens.TweenBuilderConfig | Phaser.Types.Tweens.TweenChainBuilderConfigPhaser.Tweens.TweenPhaser.Tweens.TweenChain

Returns: Phaser.Tweens.Tween - The Tween that was created.

Source: src/tweens/tween/Tween.js#L850
Since: 3.0.0


tweenchain

<instance> tweenchain(config)

Description:

Creates a new TweenChain object and returns it, without adding it to the Tween Manager.

Note: This method will only be available if Tweens have been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.Tweens.TweenBuilderConfig | objectNoThe TweenChain configuration.

Returns: Phaser.Tweens.TweenChain - The TweenChain that was created.

Source: src/tweens/tween/TweenChain.js#L566
Since: 3.60.0


video

<instance> video(config, [addToScene])

Description:

Creates a new Video Game Object and returns it.

Note: This method will only be available if the Video Game Object has been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.Video.VideoConfigNoThe configuration object this Game Object will use to create itself.
addToScenebooleanYesAdd this Game Object to the Scene after creating it? If set this argument overrides the add property in the config object.

Returns: Phaser.GameObjects.Video - The Game Object that was created.

Source: src/gameobjects/video/VideoCreator.js#L12
Since: 3.20.0


zone

<instance> zone(config)

Description:

Creates a new Zone Game Object and returns it.

Note: This method will only be available if the Zone Game Object has been built into Phaser.

Parameters:

nametypeoptionaldescription
configPhaser.Types.GameObjects.Zone.ZoneConfigNoThe configuration object this Game Object will use to create itself.

Returns: Phaser.GameObjects.Zone - The Game Object that was created.

Source: src/gameobjects/zone/ZoneCreator.js#L11
Since: 3.0.0