pixi-viewport icon indicating copy to clipboard operation
pixi-viewport copied to clipboard

How to use @pixi/events with this library?

Open boy51 opened this issue 2 years ago • 3 comments

Hi, thanks for this package, been enjoying using it! I have a basic question I couldn't find an answer for.

So we have @pixi/events, which apparently is better than InteractionManager and according to bigtimebuddy is going to replace Interaction soon.

I'm not sure if this library strictly requires InteractionManager. I know that its needed for mousewheel zoom to work correctly.

However, when disabling InteractionManager in my project, I saw some more issues. For example, panning would stop if I mouseover any entity that is on top of the viewport.

I can guess that this is because Events will work more like the DOM, so with InteractionManager events may propagate freely, but now they may be stopped on propagation.

That being said, do you have plans to support @pixi/events? I'm trying to jump in a project and would like to use this lib with events. I would love to assist if it doesn't involve a complete rework, as I'm not very familiar with events or this library.

Thanks!

boy51 avatar Feb 28 '22 17:02 boy51

I don't currently have plans to support it, but it's definitely something I'm interested in. I broke out the interaction code into InputManager.ts a while ago. I expect there should be a way to roll an InputManagerEvents.ts that uses the new events, and then allow the developer to choose between the two input managers. Happy to look at code if you have time to implement.

davidfig avatar Feb 28 '22 20:02 davidfig

For the record, I ended up using this library as is for now, so I won't be doing it anytime soon. So its up to you if you want to leave this issue open. I think your suggestion will work though and it won't be very hard. From what I saw events is not much different than @pixi/events.

boy51 avatar May 02 '22 15:05 boy51

I would also be interested in seeing this

harrycollin avatar May 16 '22 18:05 harrycollin