Methods
Static
off
- off(body, eventName, callback?): void
-
Returns void
- off(composite, eventName, callback?): void
-
Returns void
- off(engine, eventName, callback?): void
-
Returns void
- off(mouse, eventName, callback?): void
-
Returns void
- off(runner, eventName, callback?): void
-
Returns void
- off(runner, eventName, callback?): void
-
Returns void
- off<T, F>(object, eventNames?, callback?): void
-
Type Parameters
-
T extends {
events: Record<string, F[]>;
}
-
Parameters
-
object: T
-
Optional
eventNames: string | F
-
Optional
callback: F
Returns void
Static
on
- on(body, eventName, callback): BodyEventFunction
-
- on(composite, eventName, callback): CompositeEventFunction
-
- on(engine, eventName, callback): EngineEventFunction
-
- on(mouse, eventName, callback): MouseEventFunction
-
- on(runner, eventName, callback): RunnerEventFunction
-
- on(runner, eventName, callback): RenderEventFunction
-
- on<F, T>(object, eventNames, callback): F
-
Type Parameters
-
F extends Function
-
T extends {
events: Record<string, F[]>;
}
Parameters
-
object: T
-
eventNames: string
-
callback: F
Returns F
Static
trigger
- trigger(body, eventName, event?): void
-
Parameters
-
-
-
Optional
event: Partial<IBodyEvent>
Returns void
- trigger(composite, eventName, event): void
-
Parameters
-
-
-
event: Partial<ICompositeEvent>
Returns void
- trigger(mouse, eventName, event): void
-
Parameters
-
-
-
event: Partial<IMouseEvent>
Returns void
- trigger(engine, eventName, event): void
-
Parameters
-
-
-
event: Partial<IEngineEvent>
Returns void
- trigger(runner, eventName, event): void
-
Parameters
-
-
-
event: Partial<IRunnerEvent>
Returns void
- trigger(runner, eventName, event): void
-
Parameters
-
-
-
event: Partial<IRenderEvent>
Returns void
- trigger<T, E>(object, eventNames, event?): void
-
Type Parameters
-
T extends {
events: Record<string, Function[]>;
}
-
E extends IEvent<string, T>
Parameters
-
object: T
-
eventNames: string
-
Optional
event: Partial<E>
Returns void
The
Matter.Events
module contains methods to fire and listen to events on other objects.See the included usage examples.