From d749a7c40577ca7cb522e65d9ea3e79a3a9d04b5 Mon Sep 17 00:00:00 2001 From: Kleber Silva Date: Mon, 6 Sep 2021 09:36:40 -0300 Subject: [PATCH] added a new way of instantiation --- example/game.js | 2 +- example/index.html | 3 +++ src/plugin.ts | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/example/game.js b/example/game.js index 902d10e..fa1e47f 100644 --- a/example/game.js +++ b/example/game.js @@ -26,7 +26,7 @@ function preload() { function create() { const refImage = new Phaser.Image(game, 0, 0, 'ref'); - game.plugins.add(new PhaserRuntimeEditor.Plugin(game, game.world, refImage)); + game.plugins.add(new Phaser.Plugin.RuntimeEditor(game, game.world, refImage)); // Modify the world and camera bounds // game.world.setBounds(-1000, -1000, 2000, 2000); diff --git a/example/index.html b/example/index.html index 3d77432..f8f9acf 100644 --- a/example/index.html +++ b/example/index.html @@ -6,7 +6,10 @@ Example + + + diff --git a/src/plugin.ts b/src/plugin.ts index 2c9b963..cb20ce9 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -148,3 +148,5 @@ export class Plugin extends Phaser.Plugin { Editor.data.dispatchScheduledEvents(); } } + +(Phaser.Plugin as any).RuntimeEditor = Plugin;