http://www.goodboydigital.com/pixi-js-gets-interactive/
Stage.prototype.initialize = function() { PIXI.Stage.call(this); // The interactive flag causes a memory leak. this.interactive = false;};I started by setting this to true, despite the warningThen I started to modify some sprites
Spriteset_Map.prototype.createCharacters = function() { this._characterSprites = []; $gameMap.events().forEach(function(event) { var spr = new Sprite_Character(event) spr.interactive = true spr.mouseover = function() { console.log("here"); } this._characterSprites.push(spr); }, this); $gameMap.vehicles().forEach(function(vehicle) { this._characterSprites.push(new Sprite_Character(vehicle)); }, this); $gamePlayer.followers().reverseEach(function(follower) { this._characterSprites.push(new Sprite_Character(follower)); }, this); this._characterSprites.push(new Sprite_Character($gamePlayer)); for (var i = 0; i < this._characterSprites.length; i++) { this._tilemap.addChild(this._characterSprites); } };Hoping that when I move my mouse over the event sprite, it will print some stuff out.However, it doesn't work as I hoped.
Is there a way to use the interactive callbacks?
Stage.prototype.initialize = function() { PIXI.Stage.call(this); // The interactive flag causes a memory leak. this.interactive = false;};I started by setting this to true, despite the warningThen I started to modify some sprites
Spriteset_Map.prototype.createCharacters = function() { this._characterSprites = []; $gameMap.events().forEach(function(event) { var spr = new Sprite_Character(event) spr.interactive = true spr.mouseover = function() { console.log("here"); } this._characterSprites.push(spr); }, this); $gameMap.vehicles().forEach(function(vehicle) { this._characterSprites.push(new Sprite_Character(vehicle)); }, this); $gamePlayer.followers().reverseEach(function(follower) { this._characterSprites.push(new Sprite_Character(follower)); }, this); this._characterSprites.push(new Sprite_Character($gamePlayer)); for (var i = 0; i < this._characterSprites.length; i++) { this._tilemap.addChild(this._characterSprites); } };Hoping that when I move my mouse over the event sprite, it will print some stuff out.However, it doesn't work as I hoped.
Is there a way to use the interactive callbacks?