Jump to content

Event interception


MistOfShades
 Share

Recommended Posts

Hello fellow gamemakers! I have a question about PIXI InteractionManager
My Pixi version is 5.3.7. I'm testing on desktop Windows 10 and latest Chrome.

Is it safe to interrupt InteractionEvent and change it's .currentTarget and .target properties?

I have an object which on drag creates another object and calls it's .onDrag(event) method with event.target changed to new object, so drag can happen seamlessly.
Like, for example, imagine a coin pile as a singular Sprite, that on drag creates one coin Sprite.

So, for now it kinda works. But I read source code for InteractionManager and didn't found anything directly related to .target property in hit-tests logic.
Thus I decided to aks here. Is it safe to juggle events between objects like that, or such behaviour completely unintended and can break in future versions?

Link to comment
Share on other sites

Is it safe to interrupt InteractionEvent and change it's .currentTarget and .target properties?

Its on level "i wanna make interactionManager work like i want". Not safe, but required for many games :) PixiJS InteractionManager is often not enough, that's why, for example, we have separate TreeSearch class - people can override certain algorithms.

Edited by ivan.popelyshev
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...