Type Definitions
-
DisplayObject
-
A display object is any object that can be rendered in the Phaser/pixi.js scene graph:
Type:
- object
- Source:
- src/core/Group.js line 3091
-
GameConfig
-
A configuration object for Phaser.Game.
Type:
- object
- Source:
- src/core/Game.js line 548
Properties:
Name Type Argument Default Description GameConfig.alignHboolean <optional>
false GameConfig.alignVboolean <optional>
false GameConfig.antialiasboolean <optional>
true GameConfig.backgroundColornumber | string <optional>
0 GameConfig.canvasHTMLCanvasElement <optional>
An existing canvas to display the game in.
GameConfig.canvasIDstring <optional>
idattribute value to assign to the game canvas.GameConfig.canvasStylestring <optional>
styleattribute value to assign to the game canvas.GameConfig.clearBeforeRenderboolean <optional>
true GameConfig.crispboolean <optional>
false Sets the canvas's
image-renderingproperty topixelatedorcrisp-edges. See Phaser.Canvas.setImageRenderingCrisp.GameConfig.disableVisibilityChangeboolean <optional>
false GameConfig.disableStartboolean <optional>
false Prevents the game loop from starting, allowing you to call updates manually. Helpful for automated testing.
GameConfig.enableDebugboolean <optional>
true Enable Phaser.Utils.Debug. You can gain a little performance by disabling this in production.
GameConfig.failIfMajorPerformanceCaveatboolean <optional>
Abort WebGL context creation if performance would be poor. You can use this with renderer AUTO.
GameConfig.forceSetTimeOutboolean <optional>
Use setTimeout for the game loop even if requestAnimationFrame is available.
GameConfig.fullScreenScaleModenumber <optional>
The scaling method used by the ScaleManager when in fullscreen.
GameConfig.fullScreenTargetHTMLElement <optional>
The DOM element on which the Fullscreen API enter request will be invoked.
GameConfig.heightnumber | string <optional>
600 GameConfig.keyboardboolean <optional>
true Starts the keyboard input handler.
GameConfig.maxPointersnumber <optional>
-1 Sets Phaser.Input#maxPointers.
GameConfig.mouseboolean <optional>
true Starts the mouse input handler, if the mspointer and touch handlers were not started.
GameConfig.mouseWheelboolean <optional>
false Starts the mouse wheel handler, if supported by the device.
GameConfig.mspointerboolean <optional>
true Starts the Pointer Events handler (mspointer), if supported by the device.
GameConfig.multiTextureboolean <optional>
false Enable support for multiple bound Textures in WebGL. Same as
{renderer: Phaser.WEBGL_MULTI}.GameConfig.parentstring | HTMLElement <optional>
'' The DOM element into which this games canvas will be injected.
GameConfig.physicsConfigobject <optional>
GameConfig.pointerLockboolean <optional>
true Starts the Pointer Lock handler, if supported by the device.
GameConfig.powerPreferencestring <optional>
'default' Sets the WebGL renderer's powerPreference when the WebGL renderer is used.
GameConfig.preserveDrawingBufferboolean <optional>
false Whether or not the contents of the stencil buffer is retained after rendering.
GameConfig.renderernumber <optional>
Phaser.AUTO GameConfig.resolutionnumber <optional>
1 The resolution of your game, as a ratio of canvas pixels to game pixels.
GameConfig.roundPixelsboolean <optional>
false Round pixel coordinates for rendering (rather than interpolating). Handy for crisp pixel art and speed on legacy devices.
GameConfig.scaleHnumber <optional>
1 Horizontal scaling factor for USER_SCALE scale mode.
GameConfig.scaleModenumber <optional>
The scaling method used by the ScaleManager when not in fullscreen.
GameConfig.scaleVnumber <optional>
1 Vertical scaling factor for USER_SCALE scale mode.
GameConfig.seednumber <optional>
Seed for Phaser.RandomDataGenerator.
GameConfig.stateobject <optional>
GameConfig.touchboolean <optional>
true Starts the touch handler, if supported by the device and the Pointer Events handler (mspointer) was not started.
GameConfig.transparentboolean | string <optional>
false Sets Phaser.Game#transparent.
'notMultiplied'disables the WebGL context attributepremultipliedAlpha.GameConfig.trimHnumber <optional>
0 Horizontal trim for USER_SCALE scale mode.
GameConfig.trimVnumber <optional>
0 Vertical trim for USER_SCALE scale mode.
GameConfig.widthnumber | string <optional>
800 -
InputConfig
-
Type:
- object
- Source:
- src/input/Input.js line 415
Properties:
Name Type Argument Default Description keyboardboolean <optional>
true maxPointersboolean <optional>
-1 mouseboolean <optional>
true mouseWheelboolean <optional>
false mspointerboolean <optional>
true pointerLockboolean <optional>
true touchboolean <optional>
true -
TilemapObject
-
Type:
- object
- Source:
- src/tilemap/Tilemap.js line 2077
Properties:
Name Type Argument Description ellipseboolean True for an ellipse
heightnumber The height
idnumber The object identifier
namestring The name
pointboolean True for a point
rectangleboolean True for a rectangle
rotationboolean Rotation in degrees
typestring The type
visibleboolean Visible or hidden
widthnumber The width
xnumber The x coordinate in global space
ynumber The y coordinate in global space
gidnumber <nullable>
The global tile identifier, for a tile object
polygonArray.<Array.<number>> <nullable>
Vertices for a polygon
polylineArray.<Array.<number>> <nullable>
Vertices for a polyline
propertiesobject <nullable>
Custom properties
templatestring <nullable>
The template path, for a template instance
textobject <nullable>
See https://doc.mapeditor.org/en/latest/reference/json-map-format/#text