How can I use mouse interactivity API from pixi?

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?
I believe you can use the regular mousemove event to do mouse operations.
I believe you can use the regular mousemove event to do mouse operations.
You mean the ones that come with javascript?


I'm not sure how to use those since they target the DOM
--nvm im an idiot--
You mean the ones that come with javascript?

I'm not sure how to use those since they target the DOM
The TouchInput class works that way:

Code:
TouchInput._setupEventHandlers = function() {    document.addEventListener('mousedown', this._onMouseDown.bind(this));    document.addEventListener('mousemove', this._onMouseMove.bind(this));    document.addEventListener('mouseup', this._onMouseUp.bind(this));    document.addEventListener('wheel', this._onWheel.bind(this));    document.addEventListener('touchstart', this._onTouchStart.bind(this));    document.addEventListener('touchmove', this._onTouchMove.bind(this));    document.addEventListener('touchend', this._onTouchEnd.bind(this));    document.addEventListener('touchcancel', this._onTouchCancel.bind(this));    document.addEventListener('pointerdown', this._onPointerDown.bind(this));};TouchInput._onLeftButtonDown = function(event) {    var x = Graphics.pageToCanvasX(event.pageX);    var y = Graphics.pageToCanvasY(event.pageY);    if (Graphics.isInsideCanvas(x, y)) {        this._mousePressed = true;        this._pressedTime = 0;        this._onTrigger(x, y);    }};TouchInput._onMouseMove = function(event) {    if (this._mousePressed) {        var x = Graphics.pageToCanvasX(event.pageX);        var y = Graphics.pageToCanvasY(event.pageY);        this._onMove(x, y);    }};
It would be terrible if none of the interactive stuff worked because MV decided to just overwrite all of it...


It looks like author of pixiJS already made it so that you can click sprites and everything...

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-use-mouse-interactivity-api-from-pixi.47845/