Must be CbEvent.WAKE or CbEvent.SLEEP.
CbType or OptionType filter, or null to match all bodies.
Called with a BodyCallback each time the event fires.
Execution order relative to other listeners (higher = first). Default 0.
The callback function invoked when the event fires. Cannot be set to null.
The filter used to match bodies. Returns an OptionType representing the current include/exclude configuration.
Execution priority of this listener relative to other listeners for the same event and objects. The direction depends on the listener type (inherited from Haxe nape):
BodyListener / ConstraintListener: higher values run first;
on a tie the listener added last runs first.InteractionListener / PreListener: lower values run first; on a
tie the listener added first runs first. When several PreListeners
return a flag for the same pair the last one called wins — so the
highest precedence has the final say.The type of this listener (BODY, CONSTRAINT, INTERACTION, or PRE).
Listener for body lifecycle events.
Fires when a body matching the
optionsfilter wakes or sleeps.Valid events: CbEvent.WAKE, CbEvent.SLEEP.
Example