me.game

me.game represents your current game, it contains all the objects, tilemap layers, current viewport, collision map, etc...
me.game is also responsible for updating (each frame) the object status and draw them

Members

static HASH :Object

Deprecated:
  • since 7.1.0
See:

static mergeGroup :boolean

when true, all objects will be added under the root world container.
When false, a me.Container object will be created for each corresponding groups

Default Value:
  • true

static sortOn :string

Specify the property to be used when sorting entities. Accepted values : "x", "y", "z"

Default Value:
  • "z"

static viewport :me.Camera2d

a reference to the current active stage "default" camera

static world :me.World

a reference to the game world,
a world is a virtual environment containing all the game objects

Methods

static getParentContainer(child) → {me.Container}

Returns the parent container of the specified Child in the game world

Parameters:
Name Type Description
child me.Renderable
Returns:
me.Container

static onLevelLoaded()

Fired when a level is fully loaded and
and all entities instantiated.
Additionnaly the level id will also be passed to the called function.

Example
// call myFunction () everytime a level is loaded
me.game.onLevelLoaded = this.myFunction.bind(this);

static repaint()

force the redraw (not update) of all objects

static reset()

reset the game Object manager
destroy all current objects

static updateFrameRate()

Update the renderer framerate using the system config variables.

See: