Namespace: plugin

me. plugin

There is no constructor function for me.plugin
Source:
plugin.js, line 16

Classes

Base

Methods

<static> patch(proto, name, fn)

patch a melonJS function
Parameters:
Name Type Description
proto Object target object
name String target function
fn function replacement function
Source:
plugin.js, line 57
Example
// redefine the me.game.update function with a new one
me.plugin.patch(me.game, "update", function () {
  // display something in the console
  console.log("duh");
  // call the original me.game.update function
  this._patched();
});

<static> register(plugin, name)

Register a plugin.
Parameters:
Name Type Argument Description
plugin me.plugin.Base Plugin to instiantiate and register
name String
arguments... <optional>
all extra parameters will be passed to the plugin constructor
Source:
plugin.js, line 102
See:
Example
// register a new plugin
me.plugin.register(TestPlugin, "testPlugin");
// the plugin then also become available
// under then me.plugins namespace
me.plugins.testPlugin.myfunction ();
Copyright © 2011 - 2017, Olivier Biot, Jason Oster, Aaron McLeod
Documentation generated by JSDoc 3.4.0 on 2017-02-28T11:37:41+08:00 using the DocStrap template modified by codename-.