System

Module: engine.system

System manager. Instance automatically created at game.system

Properties

_newSceneName String

(No description yet)

_pausedOnHide Boolean

(No description yet)

_rotateScreenVisible Boolean (Default: false)

(No description yet)

_runLoopId Number

(No description yet)

_running Boolean

(No description yet)

_windowHeight Number

(No description yet)

_windowWidth Number

(No description yet)

canvasHeight Number

Canvas height.

canvasWidth Number

Canvas width.

delta Number

Time since last frame (seconds), shorthand game.delta

height Number

Height of the game canvas (pixels), shorthand game.height

hires Boolean

Is engine in HiRes mode.

originalHeight Number

Original height.

originalWidth Number

Original width.

paused Boolean

Is engine paused.

scene Scene

Current scene (game.scene).

sceneName String

Name of current scene.

width Number

Width of the game canvas (pixels), shorthand game.width

Methods

_hideRotateScreen()

(No description yet)

_initRenderer()

(No description yet)

_onWindowResize()

(No description yet)

_resize(width, height)

(No description yet)

Parameters:

  • width Number
  • height Number
_run()

(No description yet)

_scale(width, height)

(No description yet)

Parameters:

  • width Number
  • height Number
_setSceneNow(sceneName, [param])

(No description yet)

Parameters:

  • sceneName String
  • param * (optional)
_showRotateScreen()

(No description yet)

_startRunLoop()

(No description yet)

_stopRunLoop()

(No description yet)

_toggleRotateScreen()

(No description yet)

_updateWindowSize()

(No description yet)

fullscreen()

Request fullscreen mode.

fullscreenSupport() Boolean

Test fullscreen support.

Return true, if browser supports fullscreen mode.

loadScene(scenenName)

Load new scene using default loader.

Parameters:

  • scenenName String
pause(onHide)

Pause game engine.

Parameters:

  • onHide Boolean
resize(width, height)

Resize system.

Parameters:

  • width Number
  • height Number
resume(onHide)

Resume game engine.

Parameters:

  • onHide Boolean
setScene(sceneName, [param])

Change current scene. If you don't define sceneName, current scene will be restarted.

Parameters:

  • sceneName String
  • param String (optional)

Attributes

canvasId String (Default: canvas)

Id for canvas element, where game is placed. If none found, it will be created.

center Boolean (Default: true)

Position canvas to center of window.

frameRate Number (Default: null)

Set custom frame rate for game loop.

height Number (Default: 768)

System height.

hidpi Boolean (Default: true)

Scale canvas for HiDPI screens.

hires Number (Default: 0)

HiRes mode multiplier.

hiresDeviceSize Boolean (Default: false)

Use device size instead of window size on HiRes mode.

hiresRatio Number (Default: 2)

Ratio value, when HiRes mode is used.

loader String (Default: Loader)

Default loader class.

pauseOnHide Boolean (Default: true)

Pause engine, when page is hidden.

resize Boolean (Default: false)

Resize canvas to fill window.

rotateScreen Boolean (Default: true)

Use rotate screen on mobile.

rotateScreenClass String (Default: rotate)

Class name for document body, when rotate screen visible.

scale Boolean (Default: true)

Scale canvas to fit window.

scaleMax Number (Default: 0)

Maximum percent of scaling (0 = disabled).

scalePercent Number (Default: 100)

(No description yet)

startScene String (Default: Main)

Name of start scene.

width Number (Default: 1024)

System width.