diff --git a/src/editor.js b/src/editor.js index 834588f..fed74d6 100644 --- a/src/editor.js +++ b/src/editor.js @@ -5,12 +5,11 @@ export class Editor extends Phaser.Group { * @param {Phaser.Group} root */ constructor(game, root) { - super(game, game.stage, '_RuntimeEditor_Editor_'); + super(game, null, '_RuntimeEditor_Editor_'); this.root = root; game.add.graphics(0, 0, this) - .beginFill(0, 0.2) - .drawRect(0, 0, game.width, game.height) - .endFill(); + .lineStyle(2, 0xFF0000, 0.8) + .drawRect(0, 0, game.width, game.height); this.visible = false; } } \ No newline at end of file diff --git a/src/index.js b/src/index.js index 88ea3af..d969485 100644 --- a/src/index.js +++ b/src/index.js @@ -18,7 +18,9 @@ class RuntimeEditor extends Phaser.Plugin { */ setup(game, group) { const editor = new Editor(game, group) - new Panel(game, editor); + const panel = new Panel(game, editor); + game.stage.add(editor); + game.stage.add(panel); } } diff --git a/src/panel.js b/src/panel.js index cf9fadd..3665e00 100644 --- a/src/panel.js +++ b/src/panel.js @@ -6,7 +6,7 @@ export class Panel extends Phaser.Group { * @param {Editor} editor */ constructor(game, editor) { - super(game, game.stage, '_RuntimeEditor_Panel_'); + super(game, null, '_RuntimeEditor_Panel_'); this.editor = editor; this.createPanel(game); } @@ -15,7 +15,7 @@ export class Panel extends Phaser.Group { * @param {Phaser.Game} game */ createPanel(game) { - var text = game.add.text(0, 0, 'EDIT', { font: '24px "Source Code Pro",Consolas,"Courier New",monospaced', fontWeight: 'bold', fill: '#FFFFFF' }); + var text = game.add.text(0, 0, 'EDIT', { font: '16px "Source Code Pro",Consolas,"Courier New",monospaced', fontWeight: 'bold', fill: '#FFFFFF' }, this); text.inputEnabled = true; text.input.useHandCursor = true; text.events.onInputDown.add(this.toggleEditor, this);