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:
-
itemObjectpaper.js Item
-
nameStringAn identifier for this callback
-
callbackFunction -
parentItemObjectIf 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:
-
evObjectThe event object
remove
-
item -
name
Remove a callback from an item's onFrame handler.
Parameters:
-
itemObjectpaper.js Item object
-
nameStringThe identifier of the callback you want to remove
