Kamaz Posted November 14, 2017 Share Posted November 14, 2017 I draw all the game objects (images, animations, fonts) using renderTexture in State.Update(). Is there any way to handle mouse events? Without adding to the stage. Simple example, events don't work: public create(): void { let self = this; this.texture = this.game.add.renderTexture(this.game.width, this.game.height); this.game.add.sprite(0, 0, this.texture); this.image = this.parentGame.game.make.sprite(0, 0, this.filename); this.image.inputEnabled = true; this.image.input.useHandCursor = true; this.image.events.onInputDown.add(function () { if (self.onMouseEvent) { self.onMouseEvent(); } }); } public update(): void { this.texture.renderXY(this.image, 0, 0, this.clearBeforeDraw); } Link to comment Share on other sites More sharing options...
Recommended Posts