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 add
Phaser.GameObjectFactory Reference to the GameObject Factory. -
antialias
-
- Source:
- core/Game.js, line 66
Properties:
Name Type Description antialias
boolean 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 cache
Phaser.Cache Reference to the assets cache. -
camera
-
- Default Value:
- null
- Source:
- core/Game.js, line 204
Properties:
Name Type Description camera
Phaser.Physics.PhysicsManager A handy reference to world.camera. -
canvas
-
- Default Value:
- null
- Source:
- core/Game.js, line 210
Properties:
Name Type Description canvas
HTMLCanvasElement A handy reference to renderer.view. -
context
-
- Default Value:
- null
- Source:
- core/Game.js, line 216
Properties:
Name Type Description context
Context 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 debug
Phaser.Utils.Debug A set of useful debug utilitie. -
device
-
- Default Value:
- null
- Source:
- core/Game.js, line 198
Properties:
Name Type Description device
Phaser.Device Contains device information and capabilities. -
height
-
- Source:
- core/Game.js, line 56
Properties:
Name Type Description height
number The Game height (in pixels). -
id
-
- Source:
- core/Game.js, line 39
Properties:
Name Type Description id
number Phaser Game ID (for when Pixi supports multiple instances). -
input
-
- Default Value:
- null
- Source:
- core/Game.js, line 132
Properties:
Name Type Description input
Phaser.Input Reference to the input manager -
isBooted
-
- Default Value:
- false
- Source:
- core/Game.js, line 102
Properties:
Name Type Description isBooted
boolean Whether the game engine is booted, aka available. -
isRunning
-
- Default Value:
- false
- Source:
- core/Game.js, line 108
Properties:
Name Type Description id
boolean Is game running or paused? -
load
-
- Default Value:
- null
- Source:
- core/Game.js, line 138
Properties:
Name Type Description load
Phaser.Loader Reference to the assets loader. -
math
-
- Default Value:
- null
- Source:
- core/Game.js, line 144
Properties:
Name Type Description math
Phaser.GameMath Reference to the math helper. -
net
-
- Default Value:
- null
- Source:
- core/Game.js, line 150
Properties:
Name Type Description net
Phaser.Net Reference to the network class. -
parent
-
- Source:
- core/Game.js, line 44
Properties:
Name Type Description parent
HTMLElement The Games DOM parent. -
particles
-
- Default Value:
- null
- Source:
- core/Game.js, line 228
Properties:
Name Type Description particles
Phaser.Particles The Particle Manager. -
physics
-
- Default Value:
- null
- Source:
- core/Game.js, line 186
Properties:
Name Type Description physics
Phaser.Physics.PhysicsManager Reference to the physics manager. -
raf
-
- Default Value:
- null
- Source:
- core/Game.js, line 114
Properties:
Name Type Description raf
Phaser.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 renderer
number The Pixi Renderer -
renderType
-
- Source:
- core/Game.js, line 89
Properties:
Name Type Description renderType
number 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 rnd
Phaser.RandomDataGenerator Instance of repeatable random data generator helper. -
sound
-
- Default Value:
- null
- Source:
- core/Game.js, line 156
Properties:
Name Type Description sound
Phaser.SoundManager Reference to the sound manager. -
stage
-
- Default Value:
- null
- Source:
- core/Game.js, line 162
Properties:
Name Type Description stage
Phaser.Stage Reference to the stage. -
state
-
- Source:
- core/Game.js, line 77
Properties:
Name Type Description state
number The StateManager. -
time
-
- Default Value:
- null
- Source:
- core/Game.js, line 168
Properties:
Name Type Description time
Phaser.TimeManager Reference to game clock. -
transparent
-
- Source:
- core/Game.js, line 61
Properties:
Name Type Description transparent
boolean Use a transparent canvas background or not. -
tweens
-
- Default Value:
- null
- Source:
- core/Game.js, line 174
Properties:
Name Type Description tweens
Phaser.TweenManager Reference to the tween manager. -
width
-
- Source:
- core/Game.js, line 51
Properties:
Name Type Description width
number The Game width (in pixels). -
world
-
- Default Value:
- null
- Source:
- core/Game.js, line 180
Properties:
Name Type Description world
Phaser.World Reference to the world.