API Docs for: 1.13.1
Show:

game.Scene Class

Extends game.Class
Module: scene

Game scene.

Methods

addEmitter

(
  • emitter
)

Add particle emitter to scene.

Parameters:

addObject

(
  • object
)

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

Parameters:

  • object Object

addTimer

(
  • time
  • callback
  • repeat
)
game.Timer

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
)

Shorthand for adding tween.

Parameters:

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

clear

()

Clear stage.

click

(
  • InteractionData
)

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

Parameters:

  • InteractionData InteractionData

exit

()

Called, when scene is changed.

keydown

()

Callback for keydown.

keyup

()

Callback for keyup.

mousedown

(
  • InteractionData
)

Callback for mousedown and touchstart on the scene stage.

Parameters:

  • InteractionData InteractionData

mousemove

(
  • InteractionData
)

Callback for mousemove and touchmove on the scene stage.

Parameters:

  • InteractionData InteractionData

mouseout

(
  • InteractionData
)

Callback for mouseout on the scene stage.

Parameters:

  • InteractionData InteractionData

mouseup

(
  • InteractionData
)

Callback for mouseup and touchend on the scene stage.

Parameters:

  • InteractionData InteractionData

removeEmitter

(
  • emitter
)

Remove emitter from scene.

Parameters:

removeObject

(
  • object
)

Remove object from scene.

Parameters:

  • object Object

removeTimer

(
  • timer
  • doCallback
)

Remove timer from scene.

Parameters:

swipe

(
  • direction
)

Callback for swipe.

Parameters:

  • direction String

update

()

This is called every frame.

Properties

backgroundColor

Number

Background color of scene.

emitters

Array

List of particle emitters in scene.

objects

Array

List of objects in scene.

stage

game.Container

Main container for scene.

swipeDist

Number

Minimum distance to trigger swipe.

Default: 100

swipeTime

Number

Maximum time to trigger swipe (ms).

Default: 500

timers

Array

List of timers in scene.