API Docs for: 1.13.1
Show:

game.System Class

Extends game.Class
Module: system

Methods

pause

()

Pause game engine.

resume

()

Resume paused game engine.

setScene

(
  • sceneClass
  • removeAssets
)

Change current scene.

Parameters:

  • sceneClass String
  • removeAssets Boolean

vibrate

(
  • time
)

Vibrate device.

Parameters:

  • time Number

    Time to vibrate.

Properties

canvas

HTMLCanvasElement

Canvas element.

currentSceneName

String

Name of current scene.

delta

Number

Current delta-time.

gameLoopId

Number

Current id of the game loop.

height

Number

Height of the game screen.

hires

Boolean

Is engine in HiRes mode.

originalHeight

Number

Original height.

originalWidth

Number

Original width.

paused

Boolean

Is engine paused.

retina

Boolean

Is engine in Retina mode.

rotateScreenVisible

Boolean

Is mobile rotate screen visible.

timer

Timer

Main game timer.

webGL

Boolean

Is WebGL enabled.

width

Number

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