new Game(width, height, renderer, parent, state, transparent, antialias)
Game constructor
Instantiate a new
Phaser.Game object.
Parameters:
| Name | Type | Description |
|---|---|---|
width |
number | The width of your game in game pixels. |
height |
number | The height of your game in game pixels. |
renderer |
number | Which renderer to use (canvas or webgl) |
parent |
HTMLElement | The Games DOM parent. |
state |
Description | Description. |
transparent |
boolean | Use a transparent canvas background or not. |
antialias |
boolean | Anti-alias graphics. |
- Source:
- core/Game.js, line 26
Members
-
add
-
- Default Value:
- null
- Source:
- core/Game.js, line 120
Properties:
Name Type Description addPhaser.GameObjectFactory Reference to the GameObject Factory. -
antialias
-
- Source:
- core/Game.js, line 66
Properties:
Name Type Description antialiasboolean Anti-alias graphics (in WebGL this helps with edges, in Canvas2D it retains pixel-art quality). -
cache
-
- Default Value:
- null
- Source:
- core/Game.js, line 126
Properties:
Name Type Description cachePhaser.Cache Reference to the assets cache. -
camera
-
- Default Value:
- null
- Source:
- core/Game.js, line 204
Properties:
Name Type Description cameraPhaser.Physics.PhysicsManager A handy reference to world.camera. -
canvas
-
- Default Value:
- null
- Source:
- core/Game.js, line 210
Properties:
Name Type Description canvasHTMLCanvasElement A handy reference to renderer.view. -
context
-
- Default Value:
- null
- Source:
- core/Game.js, line 216
Properties:
Name Type Description contextContext A handy reference to renderer.context (only set for CANVAS games) -
debug
-
- Default Value:
- null
- Source:
- core/Game.js, line 222
Properties:
Name Type Description debugPhaser.Utils.Debug A set of useful debug utilitie. -
device
-
- Default Value:
- null
- Source:
- core/Game.js, line 198
Properties:
Name Type Description devicePhaser.Device Contains device information and capabilities. -
height
-
- Source:
- core/Game.js, line 56
Properties:
Name Type Description heightnumber The Game height (in pixels). -
id
-
- Source:
- core/Game.js, line 39
Properties:
Name Type Description idnumber Phaser Game ID (for when Pixi supports multiple instances). -
input
-
- Default Value:
- null
- Source:
- core/Game.js, line 132
Properties:
Name Type Description inputPhaser.Input Reference to the input manager -
isBooted
-
- Default Value:
- false
- Source:
- core/Game.js, line 102
Properties:
Name Type Description isBootedboolean Whether the game engine is booted, aka available. -
isRunning
-
- Default Value:
- false
- Source:
- core/Game.js, line 108
Properties:
Name Type Description idboolean Is game running or paused? -
load
-
- Default Value:
- null
- Source:
- core/Game.js, line 138
Properties:
Name Type Description loadPhaser.Loader Reference to the assets loader. -
math
-
- Default Value:
- null
- Source:
- core/Game.js, line 144
Properties:
Name Type Description mathPhaser.GameMath Reference to the math helper. -
net
-
- Default Value:
- null
- Source:
- core/Game.js, line 150
Properties:
Name Type Description netPhaser.Net Reference to the network class. -
parent
-
- Source:
- core/Game.js, line 44
Properties:
Name Type Description parentHTMLElement The Games DOM parent. -
particles
-
- Default Value:
- null
- Source:
- core/Game.js, line 228
Properties:
Name Type Description particlesPhaser.Particles The Particle Manager. -
physics
-
- Default Value:
- null
- Source:
- core/Game.js, line 186
Properties:
Name Type Description physicsPhaser.Physics.PhysicsManager Reference to the physics manager. -
raf
-
- Default Value:
- null
- Source:
- core/Game.js, line 114
Properties:
Name Type Description rafPhaser.RequestAnimationFrame Automatically handles the core game loop via requestAnimationFrame or setTimeout -
renderer
-
- Default Value:
- null
- Source:
- core/Game.js, line 72
Properties:
Name Type Description renderernumber The Pixi Renderer -
renderType
-
- Source:
- core/Game.js, line 89
Properties:
Name Type Description renderTypenumber The Renderer this Phaser.Game will use. Either Phaser.RENDERER_AUTO, Phaser.RENDERER_CANVAS or Phaser.RENDERER_WEBGL. -
rnd
-
- Default Value:
- null
- Source:
- core/Game.js, line 192
Properties:
Name Type Description rndPhaser.RandomDataGenerator Instance of repeatable random data generator helper. -
sound
-
- Default Value:
- null
- Source:
- core/Game.js, line 156
Properties:
Name Type Description soundPhaser.SoundManager Reference to the sound manager. -
stage
-
- Default Value:
- null
- Source:
- core/Game.js, line 162
Properties:
Name Type Description stagePhaser.Stage Reference to the stage. -
state
-
- Source:
- core/Game.js, line 77
Properties:
Name Type Description statenumber The StateManager. -
time
-
- Default Value:
- null
- Source:
- core/Game.js, line 168
Properties:
Name Type Description timePhaser.TimeManager Reference to game clock. -
transparent
-
- Source:
- core/Game.js, line 61
Properties:
Name Type Description transparentboolean Use a transparent canvas background or not. -
tweens
-
- Default Value:
- null
- Source:
- core/Game.js, line 174
Properties:
Name Type Description tweensPhaser.TweenManager Reference to the tween manager. -
width
-
- Source:
- core/Game.js, line 51
Properties:
Name Type Description widthnumber The Game width (in pixels). -
world
-
- Default Value:
- null
- Source:
- core/Game.js, line 180
Properties:
Name Type Description worldPhaser.World Reference to the world.