new World(el, opt_options=)
Creates a new World.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
el |
Object | The DOM element representing the world. | |
opt_options= |
Object |
<optional> |
A map of initial properties. |
Members
-
isStatic
-
If world does not move, we only want to render it once, remove the inline styles and block and further rendering.
-
world
-
Worlds do not have worlds. However, assigning an object literal makes for less conditions in the update loop.
Methods
-
<private> _setBounds()
-
Sets the bounds of the world's visible area.
-
draw()
-
Updates the corresponding DOM element's style property. If world is static, we want to draw with passed properties first, then clear the style, then do nothing. If world is not static, we want to update it every frame.
-
step()
-
A noop.