module:Scene

Scene class

Constructor

new module:Scene(containeropt, optionsopt)

Scene constructor

Parameters:
NameTypeAttributesDefaultDescription
containerHTMLElement<optional>
document.body

Container of the renderer

optionsSceneOptions<optional>

Specific options

Extends

Members

(static) defaultOptions :SceneOptions

Type:
  • SceneOptions

(static) events :SceneEvents

Type:
  • SceneEvents

containerPosition :Position

Type:
  • Position

cursorPosition :Position

Type:
  • Position

fps :Number

Type:
  • Number

isClicked :Boolean

Type:
  • Boolean

isLooped :Boolean

Type:
  • Boolean

isScene :Boolean

Type:
  • Boolean

lastTick :Number

Type:
  • Number

Methods

(static) from(definition) → {Scene}

Parameters:
NameTypeDescription
definitionObject

Scene definition

Returns:
Type: 
Scene

(static) getDrawingContext(container)

Build a canvas and set it to fill the entire document.body

Parameters:
NameTypeDescription
containerHTMLElement

Element holding the canvas

hide() → {Scene}

Returns:

Itself

Type: 
Scene

isHover() → {Boolean}

Define if is hovered

Returns:
Type: 
Boolean

render() → {Scene}

Draw the whole scene

Returns:

Itself

Type: 
Scene

setCursor(cursoropt) → {Scene}

Parameters:
NameTypeAttributesDefaultDescription
cursorString<optional>
Component.cursors.default

Cursor string

Returns:

Itself

Type: 
Scene

show() → {Scene}

Returns:

Itself

Type: 
Scene

startLoop() → {Scene}

Start to render the scene each frame

Returns:

Itself

Type: 
Scene

stopLoop() → {Scene}

Stop scene from being rendered

Returns:

Itself

Type: 
Scene

Type Definitions

SceneEvents

Type:
  • Object
Properties
NameTypeDescription
changeString

SceneOptions

Type:
  • Object
Properties
NameTypeAttributesDefaultDescription
cursorString<optional>
Component.cursors.defaultOptions

Cursor on hover