new Dragger()
Creates a new Dragger object.
- Source:
Extends
Methods
-
attract(obj) → {Object}
-
Calculates a force to apply to simulate attraction/repulsion on an object.
Parameters:
Name Type Description objObject The target object. - Inherited From:
- Source:
Returns:
A force to apply.- Type
- Object
-
drag(obj) → {Object}
-
Calculates a force to apply to simulate drag on an object.
Parameters:
Name Type Description objObject The target object. - Source:
Returns:
A force to apply.- Type
- Object
-
init(world, opt_options=)
-
Initializes Dragger.
Parameters:
Name Type Argument Default Description worldObject An instance of World. opt_options=Object <optional>
A map of initial properties. opt_options.cnumber <optional>
1 Drag coefficient. opt_options.massnumber <optional>
1000 Mass. Increase for a greater gravitational effect. opt_options.isStaticboolean <optional>
true If true, object will not move. opt_options.widthnumber <optional>
100 Width. opt_options.heightnumber <optional>
100 Height. opt_options.colorArray <optional>
92, 187, 0 Color. opt_options.borderWidthnumber <optional>
this.width / 4 Border width. opt_options.borderStylestring <optional>
'double' Border style. opt_options.borderColorArray <optional>
224, 228, 204 Border color. opt_options.borderRadiusnumber <optional>
100 Border radius. opt_options.boxShadowSpreadnumber <optional>
this.width / 4 Box-shadow spread. opt_options.boxShadowColorArray <optional>
92, 187, 0 Box-shadow color. opt_options.opacitynumber <optional>
0.75 The object's opacity. opt_options.zIndexnumber <optional>
1 The object's zIndex. - Source: