API Docs for: 1.13.1
Show:

game.System Class

Extends game.Class
Defined in: engine/system.js:11
Module: system

Methods

extend

(
  • prop
)
game.Class

Inherited from game.Class: engine/core.js:757

Extend class.

Parameters:

  • prop Object

Returns:

init

(
  • arguments
)

Inherited from game.Class: engine/core.js:811

This method is called, when you create new instance of the class.

Parameters:

  • arguments Array

inject

(
  • prop
)

Inherited from game.Class: engine/core.js:825

Inject class.

Parameters:

  • prop Object

pause

()

Pause game engine.

resume

()

Resume paused game engine.

setScene

(
  • sceneClass
  • removeAssets
)

Change current scene.

Parameters:

  • sceneClass String
  • removeAssets Boolean

staticInit

(
  • arguments
)

Inherited from game.Class: engine/core.js:795

This method is called before init.

Parameters:

  • arguments Array

vibrate

(
  • time
)

Vibrate device.

Parameters:

  • time Number

    Time to vibrate.

Properties

canvas

HTMLCanvasElement

Defined in engine/system.js:41

Canvas element.

currentSceneName

String

Defined in engine/system.js:16

Name of current scene.

delta

Number

Defined in engine/system.js:31

Current delta-time.

gameLoopId

Number

Defined in engine/system.js:66

Current id of the game loop.

height

Number

Defined in engine/system.js:26

Height of the game screen.

hires

Boolean

Defined in engine/system.js:51

Is engine in HiRes mode.

originalHeight

Number

Defined in engine/system.js:81

Original height.

originalWidth

Number

Defined in engine/system.js:76

Original width.

paused

Boolean

Defined in engine/system.js:46

Is engine paused.

retina

Boolean

Defined in engine/system.js:56

Is engine in Retina mode.

rotateScreenVisible

Boolean

Defined in engine/system.js:61

Is mobile rotate screen visible.

timer

Timer

Defined in engine/system.js:36

Main game timer.

webGL

Boolean

Defined in engine/system.js:71

Is WebGL enabled.

width

Number

Defined in engine/system.js:21

Width of the game screen.

Attributes

antialias

Boolean

Use antialias (only on WebGL).

Default: false

bgColor

String

Body background color.

Default: null

bgColorMobile

String

Body background color for mobile.

Default: null

bgColorRotate

String

Body background color for mobile rotate screen.

Default: null

bgImage

String

Body background image.

Default: null

bgImageMobile

String

Body background image for mobile.

Default: null

bgImageRotate

String

Body background image for mobile rotate screen.

Default: null

bgPosition

String

Body background image position.

Default: null

canvasId

String

Id for canvas element.

Default: canvas

center

Boolean

Enable/disable canvas centering.

Default: true

height

Number

System height.

Default: 768

hires

Number

HiRes mode.

Default: 0

idtkScale

ScaleToFill | ScaleAspectFit | ScaleAspectFill

Scaling method for CocoonJS.

Default: ScaleAspectFit

left

Number

Canvas position from left, when centering is disabled.

Default: 0

maxHeight

Number

Maximum height for canvas, when using scaling on desktop.

Default: auto

maxWidth

Number

Maximum width for canvas, when using scaling on desktop.

Default: auto

minHeight

Number

Minimum height for canvas, when using scaling on desktop.

Default: auto

minWidth

Number

Minimum width for canvas, when using scaling on desktop.

Default: auto

pauseOnHide

Boolean

Pause game engine, when page is hidden.

Default: true

resize

Boolean

Enable/disable canvas scaling.

Default: true

resizeToFill

Boolean

Resize canvas to fill screen on mobile.

Default: false

retina

Boolean

Use Retina mode.

Default: false

rotateImg

URL

Rotate image for mobile.

Default: null

rotateMsg

String

Rotate message for mobile.

Default: Please rotate your device

rotateScreen

Boolean

Use rotate screen on mobile.

Default: true

scaleMode

String

Canvas scale mode.

Default: linear

scaleToFit

Boolean

Scale canvas to fit window size on desktop.

Default: false

screenCanvas

Boolean

Default: true

startScene

String

Default start scene.

Default: Main

top

Number

Canvas position from top, when centering is disabled.

Default: 0

transparent

Boolean

Use transparent renderer.

Default: false

webGL

Boolean

Enable WebGL renderer.

Default: false

width

Number

System width.

Default: 1024