public this Crafty.init([Number width, Number height, String stage_elem])
public this Crafty.init([Number width, Number height, HTMLElement stage_elem])
Sets the element to use as the stage, creating it if necessary. By default a div with id 'cr-stage' is used, but if the 'stage_elem' argument is provided that will be used instead. (see Crafty.viewport.init
)
Starts the EnterFrame
interval. This will call the EnterFrame
event for every frame.
Can pass width and height values for the stage otherwise will default to window size (see Crafty.DOM.window
).
All Load
events will be executed.
Uses requestAnimationFrame
to sync the drawing with the browser but will default to setInterval
if the browser does not support it.