Classes
Members
(static) bottom_screen :sjs.Base
Type:
- sjs.Base
(static) bottom_screen :sjs.Base
Type:
- sjs.Base
(static) left_screen :sjs.Base
Type:
- sjs.Base
(static) right_screen :sjs.Base
Type:
- sjs.Base
(static) top_screen :sjs.Base
Type:
- sjs.Base
Methods
(static) onHit(a, a, callback, percent)
Creates a new handler for when two objects
with the specified types collide. The types can
be the same.
Parameters:
Name | Type | Description |
---|---|---|
a |
string | An object type for this rule |
a |
string | Another object type for this rule |
callback |
function | A callback function of the form function(obj1, obj2){} that will be passed the two objects that have collided. |
percent |
number | A decimal number between 0 and 1 that specifies how much of the images must overlap before considering them "collided". 0% means any overlap will trigger a collision, 100% means the objects must be completely overlaped to to trigger a collision. |
(static) open(target, w, h)
Sets an element to be the root element for all
sjs objects.
Parameters:
Name | Type | Description |
---|---|---|
target |
string | The id of the target element |
w |
number | (optional) The width to set the element to. Defaults to 500. |
h |
number | (optional) The height to set the element to. Defaults to 400. |