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 |
- Source
Extends
Members
(static) defaultOptions :SceneOptions
Type:
- SceneOptions
- Source
(static) events :SceneEvents
Type:
- SceneEvents
- Source
containerPosition :Position
Type:
- Position
- Source
cursorPosition :Position
Type:
- Position
- Source
fps :Number
Type:
- Number
- Source
isClicked :Boolean
Type:
- Boolean
- Source
isLooped :Boolean
Type:
- Boolean
- Source
isScene :Boolean
Type:
- Boolean
- Source
lastTick :Number
Type:
- Number
- Source
Methods
(static) from(definition) → {Scene}
Parameters:
Name | Type | Description |
---|---|---|
definition | Object | Scene definition |
- Source
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 |
- Source
hide() → {Scene}
- Source
Returns:
Itself
- Type:
- Scene
isHover() → {Boolean}
Define if is hovered
- Source
Returns:
- Type:
- Boolean
render() → {Scene}
Draw the whole scene
- Overrides
- Source
Returns:
Itself
- Type:
- Scene
setCursor(cursoropt) → {Scene}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
cursor | String | <optional> | Component.cursors.default | Cursor string |
- Source
Returns:
Itself
- Type:
- Scene
show() → {Scene}
- Source
Returns:
Itself
- Type:
- Scene
startLoop() → {Scene}
Start to render the scene each frame
- Source
Returns:
Itself
- Type:
- Scene
stopLoop() → {Scene}
Stop scene from being rendered
- Source
Returns:
Itself
- Type:
- Scene
Type Definitions
SceneEvents
Type:
Properties- Object
Name | Type | Description |
---|---|---|
change | String |
- Source
SceneOptions
Type:
Properties- Object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
cursor | String | <optional> | Component.cursors.defaultOptions | Cursor on hover |
- Source