API Docs for: 1.13.1
Show:

game.Core Class

Defined in: src/engine/core.js:10
Module: game

Methods

addAsset

(
  • path
  • [id]
)
String

Add asset to loader.

Parameters:

  • path String
  • [id] String optional

Returns:

String:

id

addAttributes

(
  • className
  • attributes
)

Add attributes to class.

Parameters:

  • className String
  • attributes Object

addAudio

(
  • path
  • [id]
)
String

Add audio to loader.

Parameters:

  • path String
  • [id] String optional

Returns:

String:

id

body

(
  • body
)

Define body for module.

Parameters:

  • body Function

copy

(
  • object
)

Copy object.

Parameters:

  • object Object

createClass

(
  • name
  • [extend]
  • content
)

Create new class.

Parameters:

  • name String
  • [extend] String optional
  • content Object

createScene

(
  • name
  • content
)

Create new scene.

Parameters:

  • name String
  • content Object

fullscreen

()

Request fullscreen mode.

fullscreenSupport

() Boolean

Test fullscreen support.

Returns:

Boolean:

Return true, if browser supports fullscreen mode.

getJSON

(
  • id
)

Get JSON data.

Parameters:

  • id String

getTexture

(
  • id
)

Get texture from texture cache.

Parameters:

  • id String

ksort

(
  • obj
  • [compare]
)

Sort object by key names.

Parameters:

  • obj Object
  • [compare] Function optional

merge

(
  • to
  • from
)

Merge objects.

Parameters:

  • to Object
  • from Object

module

(
  • name
)

Define new module.

Parameters:

  • name String

removeAsset

(
  • id
)

Remove asset from memory.

Parameters:

  • id String

removeAssets

()

Remove all assets from memory.

require

(
  • modules
)

Require module.

Parameters:

  • modules Array

Properties

debug

game.Debug

Instance of game.Debug.

device

Object

Device / browser information.

keyboard

game.Keyboard

Instance of game.Keyboard.

pool

game.Pool

Instance of game.Pool.

scale

Number

Scale factor for Retina and HiRes mode.

scene

game.Scene

Instance of current game.Scene.

sound

game.Audio

Instance of game.Audio.

storage

game.Storage

Instance of game.Storage.

system

game.System

Instance of game.System.

TextureCache

Object

Provided by the renderer module.

Defined in src/engine/renderer.js:290

version

String

Current engine version.