module:Scene

module:Scene

Scene class

Constructor

# new module:Scene(containeropt, optionsopt)

Scene constructor

Parameters:
Name Type Attributes Default Description
container HTMLElement <optional>
document.body

Container of the renderer

options SceneOptions <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:
Name Type Description
definition Object

Scene definition

Returns:
Type
Scene

# (static) getDrawingContext(container)

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

Parameters:
Name Type Description
container HTMLElement

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:
Name Type Attributes Default Description
cursor String <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
Name Type Description
change String

# SceneOptions

Type:
  • Object
Properties
Name Type Attributes Default Description
cursor String <optional>
Component.cursors.defaultOptions

Cursor on hover