The main configuration for a plugin is set in plugin.js.
The following constants are defined in the file-level scope:
const PLUGIN_ID = "MyCompany_MyAddon";
const PLUGIN_VERSION = "220.127.116.11";
const PLUGIN_CATEGORY = "general";
The ID and version constants must match the values specified in addon.json.
This is a unique ID that identifies your plugin from all other addons. This must not be used by any other addon ever published for Construct 3. It must never change after you first publish your addon. (The name is the only visible identifier of the addon in the Construct 3 editor, so that can be changed any time, but the ID must always be the same.) To ensure it is unique, it is recommended to use a vendor-specific prefix, e.g.
A string specifying the addon version in four parts (major, minor, patch, revision). Be sure to update this when releasing updates to your addon, which must also be updated in addon.json.
The category for the plugin when displaying it in the Create New Object Type dialog. This must be one of
Updating plugin identifiers
The main class declaration of the plugin looks like this:
const PLUGIN_CLASS = SDK.Plugins.MyCompany_MyAddon = class MyCustomPlugin extends SDK.IPluginBase
Be sure to update the identifiers to describe your own plugin, in both the SDK namespace and the
Updating in type.js and instance.js
Likewise in both type.js and instance.js, you must update the following:
PLUGIN_CLASS to refer to your plugin's name
class name suffixed with
Instance. (For example the Audio plugin uses
AudioInstance as the three names.)
The plugin constructor
The main function of plugin.js is to define a class representing your plugin. In the class constructor, the configuration for the plugin is set via the
this._info member, which is an IPluginInfo interface. The constructor also reads potentially translated strings from the language subsystem.
For more information about the possible plugin configurations, see the
Specifying plugin properties
The plugin properties appear in the Properties Bar when instances of the plugin are selected. To set which properties appear, pass an array of PluginProperty to
this._info.SetProperties. An example is shown below. For more details see the
new SDK.PluginProperty("integer", "test-property", 0)