Inheritance Stage
Container View
Module hilo/view/Stage
Requires
hilo/core/Hilo, hilo/core/Class, hilo/view/Container, hilo/renderer/CanvasRenderer, hilo/renderer/DOMRenderer, hilo/renderer/WebGLRenderer, hilo/util/browser, hilo/util/util
Source
Stage.js
Stage is the root of all visual object tree, any visual object will be render only after being added to Stage or any children elements of Stage. Normally, every hilo application start with an stage instance.
Demo:
var stage = new Hilo.Stage({ renderType:'canvas', container: containerElement, width: 320, height: 480 });
Property | Defined | |
---|---|---|
canvas:HTMLCanvasElement|HTMLElement
The canvas the Stage is related to.
|
Stage | |
paused:Boolean
Paused Stage rendering.
|
Stage | |
renderer:Renderer
Stage renderer, readonly!
|
Stage | |
viewport:Object
Rendering area of the Stage.
|
Stage |
Method | Defined | |
---|---|---|
Stage(properties:Object)
Constructor
|
Stage | |
addTo(domElement:HTMLElement):Stage
Add Stage canvas to DOM container.
|
Stage | |
enableDOMEvent(type:String|Array, enabled:Boolean):Stage
Turn on/off Stage response to DOM event.
|
Stage | |
resize(width:Number, height:Number, forceResize:Boolean)
Resize the Stage.
|
Stage | |
tick(delta:Number)
Invoke tick function and Stage will update and render.
|
Stage | |
updateViewport():Object
Update the viewport (rendering area) which Stage show on the page.
|
Stage |