Global

Type Definitions

DisplayObject

Type:
  • object
Source:
src/core/Group.js line 3091

GameConfig

A configuration object for Phaser.Game.

Type:
  • object
Properties:
Name Type Argument Default Description
GameConfig.alignH boolean <optional>
false

Sets Phaser.ScaleManager#pageAlignHorizontally.

GameConfig.alignV boolean <optional>
false

Sets Phaser.ScaleManager#pageAlignVertically.

GameConfig.antialias boolean <optional>
true
GameConfig.backgroundColor number | string <optional>
0

Sets Phaser.Stage#backgroundColor.

GameConfig.canvas HTMLCanvasElement <optional>

An existing canvas to display the game in.

GameConfig.canvasID string <optional>

id attribute value to assign to the game canvas.

GameConfig.canvasStyle string <optional>

style attribute value to assign to the game canvas.

GameConfig.clearBeforeRender boolean <optional>
true

Sets Phaser.Game#clearBeforeRender.

GameConfig.crisp boolean <optional>
false

Sets the canvas's image-rendering property to pixelated or crisp-edges. See Phaser.Canvas.setImageRenderingCrisp.

GameConfig.disableVisibilityChange boolean <optional>
false

Sets Phaser.Stage#disableVisibilityChange

GameConfig.disableStart boolean <optional>
false

Prevents the game loop from starting, allowing you to call updates manually. Helpful for automated testing.

GameConfig.enableDebug boolean <optional>
true

Enable Phaser.Utils.Debug. You can gain a little performance by disabling this in production.

GameConfig.failIfMajorPerformanceCaveat boolean <optional>

Abort WebGL context creation if performance would be poor. You can use this with renderer AUTO.

GameConfig.forceSetTimeOut boolean <optional>

Use setTimeout for the game loop even if requestAnimationFrame is available.

GameConfig.fullScreenScaleMode number <optional>

The scaling method used by the ScaleManager when in fullscreen.

GameConfig.fullScreenTarget HTMLElement <optional>

The DOM element on which the Fullscreen API enter request will be invoked.

GameConfig.height number | string <optional>
600
GameConfig.keyboard boolean <optional>
true

Starts the keyboard input handler.

GameConfig.maxPointers number <optional>
-1

Sets Phaser.Input#maxPointers.

GameConfig.mouse boolean <optional>
true

Starts the mouse input handler, if the mspointer and touch handlers were not started.

GameConfig.mouseWheel boolean <optional>
false

Starts the mouse wheel handler, if supported by the device.

GameConfig.mspointer boolean <optional>
true

Starts the Pointer Events handler (mspointer), if supported by the device.

GameConfig.multiTexture boolean <optional>
false

Enable support for multiple bound Textures in WebGL. Same as {renderer: Phaser.WEBGL_MULTI}.

GameConfig.parent string | HTMLElement <optional>
''

The DOM element into which this games canvas will be injected.

GameConfig.physicsConfig object <optional>
GameConfig.pointerLock boolean <optional>
true

Starts the Pointer Lock handler, if supported by the device.

GameConfig.powerPreference string <optional>
'default'

Sets the WebGL renderer's powerPreference when the WebGL renderer is used.

GameConfig.preserveDrawingBuffer boolean <optional>
false

Whether or not the contents of the stencil buffer is retained after rendering.

GameConfig.renderer number <optional>
Phaser.AUTO
GameConfig.resolution number <optional>
1

The resolution of your game, as a ratio of canvas pixels to game pixels.

GameConfig.roundPixels boolean <optional>
false

Round pixel coordinates for rendering (rather than interpolating). Handy for crisp pixel art and speed on legacy devices.

GameConfig.scaleH number <optional>
1

Horizontal scaling factor for USER_SCALE scale mode.

GameConfig.scaleMode number <optional>

The scaling method used by the ScaleManager when not in fullscreen.

GameConfig.scaleV number <optional>
1

Vertical scaling factor for USER_SCALE scale mode.

GameConfig.seed number <optional>

Seed for Phaser.RandomDataGenerator.

GameConfig.state object <optional>
GameConfig.touch boolean <optional>
true

Starts the touch handler, if supported by the device and the Pointer Events handler (mspointer) was not started.

GameConfig.transparent boolean | string <optional>
false

Sets Phaser.Game#transparent. 'notMultiplied' disables the WebGL context attribute premultipliedAlpha.

GameConfig.trimH number <optional>
0

Horizontal trim for USER_SCALE scale mode.

GameConfig.trimV number <optional>
0

Vertical trim for USER_SCALE scale mode.

GameConfig.width number | string <optional>
800
Source:
src/core/Game.js line 548

InputConfig

Type:
  • object
Properties:
Name Type Argument Default Description
keyboard boolean <optional>
true
maxPointers boolean <optional>
-1
mouse boolean <optional>
true
mouseWheel boolean <optional>
false
mspointer boolean <optional>
true
pointerLock boolean <optional>
true
touch boolean <optional>
true
Source:
src/input/Input.js line 415

TilemapObject

Type:
  • object
Properties:
Name Type Argument Description
ellipse boolean

True for an ellipse

height number

The height

id number

The object identifier

name string

The name

point boolean

True for a point

rectangle boolean

True for a rectangle

rotation boolean

Rotation in degrees

type string

The type

visible boolean

Visible or hidden

width number

The width

x number

The x coordinate in global space

y number

The y coordinate in global space

gid number <nullable>

The global tile identifier, for a tile object

polygon Array.<Array.<number>> <nullable>

Vertices for a polygon

polyline Array.<Array.<number>> <nullable>

Vertices for a polyline

properties object <nullable>

Custom properties

template string <nullable>

The template path, for a template instance

text object <nullable>

See https://doc.mapeditor.org/en/latest/reference/json-map-format/#text

Source:
src/tilemap/Tilemap.js line 2077

phaser-ce@2.20.0 is on GitHub and NPM

Documentation generated by JSDoc 3.6.7 on 2022-12-10 using Tomorrow.