RPG Maker Forums

Hello guys, I want to discuss with you today about a problem that I noticed in all the version of pixi.js that are inserted in Rpg Maker MV.
Maybe I make something wrong, but I can't find any way to make it works.

My problem is related to bound a mouse event to a Sprite (or PIXI.Sprite) or another PIXI object (like Graphics, container etc...).
For example:

Code:
var sprite = new Sprite() (or new PIXI.Sprite() )
sprite.texture = PIXI.loader.resources['myResource'].texture
sprite.position.set(0,0)
sprite.interactive = true //This is needed for make the mouse events works;
sprite.on('mousedown', function() {console.log('myEvent') })
this.addChild(sprite)
This is a pretty basic code and as you can see I have bound to "mousedown" event an anonymous function that should pop-up a log inside the console.
However, this event (or all the other in all the forms: "pointerdown" etc...) does not seem to work or trigger anything, but checking the object properties inside console it looks like the events are bound to the related callback.

I have tried to:
• Make the container (Scene) interactive, too.
• Tried to change the prevent event default inside the Graphics._renderer;
• Try to bind the callback directly to a function

Ex sprite.mousedown = function() { console.log('myEvent') }

So, Am I missing something? Have you my same problem or It should be coded in a different way?

Thank you in advance for the help! :kaoluv:

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,470
Members
137,821
Latest member
Capterson
Top