Class: World

World

new World(opt_options=)

Creates a new World.
Parameters:
Name Type Argument Default Description
opt_options= Object <optional>
A map of initial properties.
opt_options.gravity Object <optional>
new Vector(0, 0.01) Gravity vector.
opt_options.c number <optional>
0.1 Coefficient of friction.
opt_options.resolution number <optional>
4 The world resolution. Items with scale = 1 will render with this value as their spread value.
opt_options.width number <optional>
viewportSize.width / this.resolution The world's width.
opt_options.height number <optional>
viewportSize.height / this.resolution The world's height.
opt_options.borderRadius number <optional>
0 The world's borderRadius expressed as a percentage. Some browsers (Safari) will pass this value to the world's box-shadows.
opt_options.opacity number <optional>
1 The world's opacity.
opt_options.zIndex number <optional>
1 The world's zIndex.
opt_options.colorMode number <optional>
'rgba' The world's colorMode. Valid values are 'rgba' and 'hsla'. If Modernizr detects that the browser does not support alpha channels, the world's opacity property will be used for opacity.
opt_options.backgroundColor Array | string <optional>
'transparent' The world's color. If colorMode = 'rgba', pass in an array formatted as [red, green, blue, alpha]. If colorMode = 'hsla', this property will be ignored.
opt_options.hue number <optional>
0 The world's hue. Used if colorMode = 'hsla'.
opt_options.saturation number <optional>
1 The world's saturation. Used if colorMode = 'hsla'.
opt_options.lightness number <optional>
0.5 The world's lightness. Used if colorMode = 'hsla'.
opt_options.addMenuText string <optional>
'' If the world's menu is activated, this text is appended.
opt_options.noMenu boolean <optional>
undefined If true, the world does not display a menu.
Source:

Members

<private> _pool

Object pool used to recycle objects.
Source:

world

Worlds do not have worlds. However, assigning an object literal makes for less conditions in the update loop.
Source: