Stage

Pixel~ Stage

The stage controls all things that run in Pixel.

Constructor

new Stage(options)

Source:
Takes an options object, contains the width and height.
Parameters:
Name Type Description
options object The options rendering parameter.
Properties
Name Type Attributes Default Description
width number The width of the canvas.
height number The height of the canvas.
ticker boolean <optional>
true Whether or not the canvas automatically renders every tick.

Namespaces

resources

Members

draw :CanvasRenderingContext2d

Source:
The primitive drawing function.
Type:
  • CanvasRenderingContext2d

stage :Pixel.Container

Source:
The current stage object.
Type:

view :HTMLCanvasElement

Source:
The canvas element.
Type:
  • HTMLCanvasElement

Methods

addChild(sprite)

Source:
Adds child to stage.
Parameters:
Name Type Description
sprite Pixel.Sprite Sprite to be added.

render()

Source:
Renders the entire stage.