Namespace: GameObjects

Phaser.Types. GameObjects

Namespaces

BitmapText
Graphics
Group
Particles
PathFollower
RenderTexture
Sprite
Text
TileSprite

Type Definitions


GameObjectConfig

Type:
  • object
Properties:
Name Type Argument Default Description
x number <optional>
0

The x position of the Game Object.

y number <optional>
0

The y position of the Game Object.

depth number <optional>
0

The depth of the GameObject.

flipX boolean <optional>
false

The horizontally flipped state of the Game Object.

flipY boolean <optional>
false

The vertically flipped state of the Game Object.

scale number | object <optional>
<nullable>
null

The scale of the GameObject.

scrollFactor number | object <optional>
<nullable>
null

The scroll factor of the GameObject.

rotation number <optional>
0

The rotation angle of the Game Object, in radians.

angle number <optional>
<nullable>
null

The rotation angle of the Game Object, in degrees.

alpha number <optional>
1

The alpha (opacity) of the Game Object.

origin number | object <optional>
<nullable>
null

The origin of the Game Object.

scaleMode number <optional>
ScaleModes.DEFAULT

The scale mode of the GameObject.

blendMode number <optional>
BlendModes.DEFAULT

The blend mode of the GameObject.

visible boolean <optional>
true

The visible state of the Game Object.

add boolean <optional>
true

Add the GameObject to the scene.

Since: 3.0.0
Source: src/gameobjects/typedefs/GameObjectConfig.js (Line 1)

JSONGameObject

Type:
  • object
Properties:
Name Type Description
name string

The name of this Game Object.

type string

A textual representation of this Game Object, i.e. sprite.

x number

The x position of this Game Object.

y number

The y position of this Game Object.

scale object

The scale of this Game Object

Properties
Name Type Description
x number

The horizontal scale of this Game Object.

y number

The vertical scale of this Game Object.

origin object

The origin of this Game Object.

Properties
Name Type Description
x number

The horizontal origin of this Game Object.

y number

The vertical origin of this Game Object.

flipX boolean

The horizontally flipped state of the Game Object.

flipY boolean

The vertically flipped state of the Game Object.

rotation number

The angle of this Game Object in radians.

alpha number

The alpha value of the Game Object.

visible boolean

The visible state of the Game Object.

scaleMode integer

The Scale Mode being used by this Game Object.

blendMode integer | string

Sets the Blend Mode being used by this Game Object.

textureKey string

The texture key of this Game Object.

frameKey string

The frame key of this Game Object.

data object

The data of this Game Object.

Since: 3.0.0
Source: src/gameobjects/typedefs/JSONGameObject.js (Line 1)