frameManager Class
The frameManager
is used to bind and unbind multiple callbacks to an object's
onFrame
. If an object has at least one handler, it's onFrame
handler will be
FrameManager/frameManagerHandler:method.
Item Index
Methods
Methods
add
-
item
-
name
-
callback
-
parentItem
Add a callback to a paper.js Item's onFrame
event.
The Item itself will be the thisValue
and the event object ev
will be the first argument
Parameters:
-
item
Objectpaper.js Item
-
name
StringAn identifier for this callback
-
callback
Function -
parentItem
ObjectIf provided, the callback will be called on parentItem.onFrame event instead of item.onFrame
Example:
animatePaper.frameManager.add(circle,"goUp",function(ev) {
// Animation logic
});
frameManagerHandler
-
ev
This is the only function called in a objects onFrame
handler.
If the objects has callbacks in it's data._customHandlers
property,
each of these is called.
Parameters:
-
ev
ObjectThe event object
remove
-
item
-
name
Remove a callback from an item's onFrame
handler.
Parameters:
-
item
Objectpaper.js Item object
-
name
StringThe identifier of the callback you want to remove