API Docs for: 0.2
Show:

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

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 Object

    paper.js Item

  • name String

    An identifier for this callback

  • callback Function
  • parentItem Object

    If 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
)
private

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 Object

    The event object

remove

(
  • item
  • name
)

Remove a callback from an item's onFrame handler.

Parameters:

  • item Object

    paper.js Item object

  • name String

    The identifier of the callback you want to remove