Jump to content

PIXI.interaction in RPG Maker MV


R. Grey
 Share

Recommended Posts

(I've seen many threads about PIXI in MV before, but not about this subject, so I make a new one. If someone already made one, I would be grateful if you link it below)

A group of people I'm collaborating with is using RPG Maker MV. I don't have much experience with this engine before, but IMHO, the engine performance is ... erm, not very good, and it also lacks many pointer/touch related events that I need.

I managed to convert the bitmap system to pure PIXI sprites. But,

sprite.interactive = true;
sprite.on('pointerdown', foo)

is still not working. I thought that maybe MV overrided PIXI somehow, so I take out all input classes of MV, 

TouchInput.init();
Input.init();
TouchInput.update();
Input.update();

still failed. Also tried manually updating plugins.interaction in the game loop. Same result.

So what is it that I am missing? Did MV override PIXI interaction with something else that I hadn't taken out, or do I need to update other certain PIXI classes in order to solve this problem?

Link to comment
Share on other sites

don't use pixi interactive in the rmmv engine.
Also rmmv dev add note that made memory leak.

Stage.prototype.initialize = function() {
PIXI.display.Stage.call(this);
 
// The interactive flag causes a memory leak.
this.interactive = false;
};

 

just use event listener.

document.addEventListener('mousemove', mousemove_Editor);
document.addEventListener('mousedown', mousedown_Editor);
document.addEventListener('mouseup',mouseup_Editor);
document.addEventListener('wheel', wheel_Editor);
document.addEventListener('keydown', keydown_Editor); 

 

You can easily bind what you need to a method.
Or made Global array that old what you need.
they are very good performance.

 

You can also debug or check in you console for understand .

 

image.thumb.png.11755b82573ae01a349b75c4420a240f.png

 
Link to comment
Share on other sites

9 hours ago, ivan.popelyshev said:

interactive memory leak was a thing back then when it was based on v3. Im not sure whether it leaks in v4.

I guess it true, I did not really get interested in the pixi interaction module.

Knowing that the event listener dom are rather simple and powerful.

There is a particular interest in using the pixi interaction module (performance, simpliciter) ?

Link to comment
Share on other sites

  • 2 weeks later...
On 4/30/2018 at 11:36 AM, ivan.popelyshev said:

To use pixi interaction in MV, there is a special hack. something-something put "pointer-events:none" on foreground div, I dont remember which :)

I've sent you a PM with contacts of people who know that issue.


 
var Gamefall = Gamefall || {};
Gamefall.Test = Gamefall.Test || {};

(function($) {
    $.GraphicsChanges = {
        modeBox: Graphics._createModeBox,
        video: Graphics._updateVideo,
        upperCanvas: Graphics._createUpperCanvas
    }

    Graphics._createModeBox = function() {
        $.GraphicsChanges['modeBox'].call(this)
        this._modeBox.style.pointerEvents = 'none'
    };

    Graphics._updateVideo = function() {
        $.GraphicsChanges['video'].call(this)
        this._video.style.pointerEvents = 'none'
    };

    Graphics._createUpperCanvas = function() {
        $.GraphicsChanges['upperCanvas'].call(this)
        this._upperCanvas.style.pointerEvents = 'none'
    };
}(Gamefall.Test)

https://forums.rpgmakerweb.com/index.php?threads/bind-mouse-event-to-pixi-object.95301/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...