Construct 2 has been officially retired. Now you should upgrade to Construct 3.

Construct 2 Javascript SDK documentation

Developers can extend Construct 2 with their own plugins and behaviors using the Javascript SDK. This manual documents how to use the SDK and the features Construct 2 exposes through the plugin interface.

This is a technical manual for javascript programmers. If you're looking for help on how to use Construct 2, please see the Construct 2 manual.

Familiarity with Construct 2 is recommended before developing with the SDK. The terminology and functions may be hard to understand otherwise. The beginner's guide is a good place for developers to start learning how Construct 2 works.

Download the SDK template to get started. The download includes a template plugin, behavior and effect which serves as a useful starting point for developing your own Construct 2 addons.

Uses for the Javascript SDK

The Javascript SDK allows you to integrate your own Javascript code in to your Construct 2 games. This is especially useful for integrating Construct 2 games with your own or third-party web-based services or backends, such as your own login and high-score systems, or to integrate a third-party advertising or payment solution. In addition to that, you can create your own new features in Construct 2 tailored to your specific game by writing some of the logic in Javascript, or expose brand new or platform-specific features to the Construct 2 event system.

Developer mode for previewing

By default Construct 2 only loads runtime scripts when previewing a project for the first time. Closing and reopening a project will cause Construct 2 to re-load the runtime scripts for all plugins. However, you can also set Construct 2 in to 'developer mode' which causes it to re-load plugin runtime scripts every time you press preview. This can save time during development since you can edit scripts while keeping a project open. To set developer mode, run regedit and open the following registry key (create it if it doesn't exist):

HKEY_CURRENT_USER\Software\Scirra\Construct2\html5

and add the key devmode and set it to 1 (DWORD value). Note this does not affect edittime scripts - these are only ever loaded the first time the editor starts up, so to reload them you must still close and reopen Construct 2.

Construct 2 Javascript SDK Manual 2021-12-13