-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event System #8
Comments
An event system is now available in the Matter.js edge build, under the namespace See the events demo of the event system in use. Usage is generally:
E.g.
A full example of usage is shown in the latest demo code. Currently only the Engine has defined events, which include See the API Docs (edge) for more info, specifically Events and Engine Events. This system is very new, so please log any issues you find, cheers. |
Great. |
I suggest another event, when the mouse touched a body.
----> Events.trigger(_engine, 'bodytouched', body);
|
The event system is now included in the latest release: If you still need to detect if the mouse has clicked on a body, see here for reference: This is the demo code that allows body removal by right clicking in the demo. Since the event system is now in place, I will close this thread. |
I want use event like this: Can it be achieved? |
That won't work, probably the easiest way would be the startdrag event on a |
An event system is required for external input into the physics engine.
It should at least include events for
The text was updated successfully, but these errors were encountered: