class nape.callbacks.BodyListener extends Listener

Available on all platforms

Event listener for Body type events. *

* The events that can be caught are WAKE and SLEEP type events. * Theses listeners will only operate on Bodys, not Interactors in general.

Instance Fields

var options:OptionType

The OptionType used to match against Bodies. *

* When added to the same Space, any Body who's CbType list matches * against this OptionType will be issued a callback when the relevant * event occurs.

function new(event:CbEvent, options:Null<Dynamic>, handler:BodyCallback ->Void, ?precedence:Int = 0):Void

Construct a new BodyListener. *

* The possible event types are WAKE and SLEEP. *

* The options argument is typed Dynamic, and is permitted to be either an * OptionType or one of: * CbType, CbTypeList, Array<CbType>, flash.Vector<CbType> * In which case the input CbType's will be used to construct an OptionType * whose included types will be the set of CbTypes supplied. * *

event

The event type to listen for. *

options

The OptionType to match Bodys against, passing null * will equate to an empty OptionType. *

handler

The callback handler for this listener. *

precedence

The precedence of this listener used to sort * the order of callbacks in the case of more than * one suitable BodyListener existing for the same * event on the same Body. (default 0) *

returns

The newly constructed BodyListener *

function handler(:BodyCallback):Void

The callback handler for this listener.