registerPlugin(pw {Object})

registerPlugin(pw {Object})
Initializes the start() function in the passed plugin wrapper pw.

pw {Object} a JSON-based object which has:

start: {Function} a method for initializing the Modes, HTML, etc. of your plugin.

Once your script is loaded using the insertPlugin, and insertModePlugin, and activate is called, the TILE.engine will run through its array of plugin *src* values and attach each one to head. After this is done, it is up to your plugin to use the registerPlugin method call to send its wrapper with the necessary start() function to TILE.engine.

Note on providing plugin names: Whatever name you give is used to figure out where in the plugins/ folder that plugin is located. For example, passing ImageTagger will result in plugins/ImageTagger/tileplugin.js. It’s assumed that there is a tileplugin.js file in that folder that contains the necessary functions to register your plugin.

Post a Comment

You must be logged in to post a comment.