API Docs for: 1.13.1
Show:

game.Scene Class

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

Game scene.

Methods

addEmitter

(
  • emitter
)

Defined in engine/scene.js:126

Add particle emitter to scene.

Parameters:

addObject

(
  • object
)

Defined in engine/scene.js:107

Add object to scene, so it's update() function get's called every frame.

Parameters:

  • object Object

addTimer

(
  • time
  • callback
  • repeat
)
game.Timer

Defined in engine/scene.js:144

Add timer to game scene.

Parameters:

  • time Number

    Time in milliseconds

  • callback Function

    Callback function to run, when timer ends.

  • repeat Boolean

Returns:

addTween

(
  • obj
  • props
  • time
  • settings
)

Defined in engine/scene.js:173

Shorthand for adding tween.

Parameters:

  • obj Object
  • props Object
  • time Number
  • settings Object

clear

()

Defined in engine/scene.js:97

Clear stage.

click

(
  • InteractionData
)

Defined in engine/scene.js:190

Callback for mouse click and touch tap on the scene stage.

Parameters:

  • InteractionData InteractionData

exit

()

Defined in engine/scene.js:287

Called, when scene is changed.

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

keydown

()

Defined in engine/scene.js:225

Callback for keydown.

keyup

()

Defined in engine/scene.js:231

Callback for keyup.

mousedown

(
  • InteractionData
)

Defined in engine/scene.js:197

Callback for mousedown and touchstart on the scene stage.

Parameters:

  • InteractionData InteractionData

mousemove

(
  • InteractionData
)

Defined in engine/scene.js:211

Callback for mousemove and touchmove on the scene stage.

Parameters:

  • InteractionData InteractionData

mouseout

(
  • InteractionData
)

Defined in engine/scene.js:218

Callback for mouseout on the scene stage.

Parameters:

  • InteractionData InteractionData

mouseup

(
  • InteractionData
)

Defined in engine/scene.js:204

Callback for mouseup and touchend on the scene stage.

Parameters:

  • InteractionData InteractionData

removeEmitter

(
  • emitter
)

Defined in engine/scene.js:135

Remove emitter from scene.

Parameters:

removeObject

(
  • object
)

Defined in engine/scene.js:117

Remove object from scene.

Parameters:

  • object Object

removeTimer

(
  • timer
  • doCallback
)

Defined in engine/scene.js:160

Remove timer from scene.

Parameters:

staticInit

(
  • arguments
)

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

This method is called before init.

Parameters:

  • arguments Array

swipe

(
  • direction
)

Defined in engine/scene.js:261

Callback for swipe.

Parameters:

  • direction String

update

()

Defined in engine/scene.js:294

This is called every frame.

Properties

backgroundColor

Number

Defined in engine/scene.js:17

Background color of scene.

emitters

Array

Defined in engine/scene.js:32

List of particle emitters in scene.

objects

Array

Defined in engine/scene.js:22

List of objects in scene.

stage

game.Container

Defined in engine/scene.js:37

Main container for scene.

swipeDist

Number

Defined in engine/scene.js:42

Minimum distance to trigger swipe.

Default: 100

swipeTime

Number

Defined in engine/scene.js:48

Maximum time to trigger swipe (ms).

Default: 500

timers

Array

Defined in engine/scene.js:27

List of timers in scene.