Class: World

Phaser. World

Phaser.World

new World(game)

"This world is but a canvas to our imagination." - Henry David Thoreau

<p> A game has only one world. The world is an abstract place in which all game objects live. It is not bound by stage limits and can be any size. You look into the world via cameras. All game objects live within the world at world-based coordinates. By default a world is created the same size as your Stage.

Parameters:
Name Type Description
game Phaser.Game

Reference to the current game instance.

Source:

Members

bounds

Properties:
Name Type Description
bounds Phaser.Rectangle

Bound of this world that objects can not escape from.

Source:

camera

Properties:
Name Type Description
camera Phaser.Camera

Camera instance.

Source:

<readonly> centerX

Properties:
Name Type Description
centerX number

Gets the X position corresponding to the center point of the world.

Source:

<readonly> centerY

Properties:
Name Type Description
centerY number

Gets the Y position corresponding to the center point of the world.

Source:

currentRenderOrderID

Properties:
Name Type Description
currentRenderOrderID number

Reset each frame, keeps a count of the total number of objects updated.

Source:

game

Properties:
Name Type Description
game Phaser.Game

A reference to the currently running Game.

Source:

group

Properties:
Name Type Description
group Phaser.Group

Object container stores every object created with create* methods.

Source:

height

Properties:
Name Type Description
height number

Gets or sets the current height of the game world.

Source:

<readonly> randomX

Properties:
Name Type Description
randomX number

Gets a random integer which is lesser than or equal to the current width of the game world.

Source:

<readonly> randomY

Properties:
Name Type Description
randomY number

Gets a random integer which is lesser than or equal to the current height of the game world.

Source:

width

Properties:
Name Type Description
width number

Gets or sets the current width of the game world.

Source:

Methods

<protected> boot()

Initialises the game world.

Source:

destroy()

Destroyer of worlds.

Source:

postUpdate()

This is called automatically every frame, and is where main logic happens.

Source:

setSize(width, height)

Updates the size of this world.

Parameters:
Name Type Description
width number

New width of the world.

height number

New height of the world.

Source:

update()

This is called automatically every frame, and is where main logic happens.

Source:
Phaser Copyright © 2012-2013 Photon Storm Ltd.
Documentation generated by JSDoc 3.2.0-dev on Thu Oct 03 2013 02:35:50 GMT+0100 (BST) using the DocStrap template.