mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-30 10:20:52 -05:00
36 lines
744 B
JavaScript
36 lines
744 B
JavaScript
(function() {
|
|
|
|
var Common = Matter.Common;
|
|
|
|
var MatterPlugin2 = {
|
|
name: 'matter-plugin-2',
|
|
|
|
version: '0.1.0',
|
|
|
|
for: 'matter-js@^0.10.0',
|
|
|
|
uses: ['matter-plugin-fake'],
|
|
|
|
options: {
|
|
thing: 1
|
|
},
|
|
|
|
install: function(matter) {
|
|
matter.Engine.create = Common.chain(
|
|
matter.Engine.create,
|
|
MatterPlugin2._engineCreate
|
|
);
|
|
},
|
|
|
|
_engineCreate: function(element, options) {
|
|
var engine = this;
|
|
|
|
console.log('patched engine create!', engine);
|
|
}
|
|
};
|
|
|
|
Matter.Plugin.exports(MatterPlugin2);
|
|
|
|
window.MatterPlugin2 = MatterPlugin2;
|
|
|
|
})();
|