0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2025-02-11 19:24:48 -05:00

Updated Using plugins (markdown)

Liam 2016-10-18 23:54:50 +01:00
parent 12df89bcc9
commit c87fe1d209

@ -64,6 +64,8 @@ Also note that plugins may only ever be installed once on a given module.
Any plugins that could not be resolved will show a red cross ❌, any plugins that threw any warnings will show a 🔶. Any plugins that could not be resolved will show a red cross ❌, any plugins that threw any warnings will show a 🔶.
The latter may or may not operate as expected, depending on the reason for the warning. The latter may or may not operate as expected, depending on the reason for the warning.
Make sure that you install plugins as _early as possible_ in your project lifecycle, before creating any function aliases (e.g. `var Body = Matter.Body;`) otherwise those aliases will not refer to the newly patched versions of those functions and your plugins will fail in unexpected ways.
You can see a working example that uses plugins in [examples/attractors.js](https://github.com/liabru/matter-js/blob/plugins/examples/airFriction.js). You can see a working example that uses plugins in [examples/attractors.js](https://github.com/liabru/matter-js/blob/plugins/examples/airFriction.js).
Advanced users should check out `Plugin.use` which provides more flexibility. Advanced users should check out `Plugin.use` which provides more flexibility.