Jump to content

Draggable region


Devb93
 Share

Recommended Posts

What would be the best way to go about making containers/objects draggable without having to add the code for every single individual object/container

I've been researching, but hitting a roadblock. I know it likely would utilize bubbling/interaction manager in some way to do so with listeners.
 

 

Link to comment
Share on other sites

I don't understand the problem :( How do you want to choose which object to move : the one that mouse is above or its parent? PixiJS scene isn't suited for that kind of stuff, its not DOM. If you set rules for it, maybe you can do it on pixi stuff, but if you want everything to be dragged, its possible that you need your own scene or at least interaction manager.

Also most of the best solutions are game-dependant and users dont share them, its not strange that you cant find them, most people cant their codebase. If something does not appear in search, that doesnt mean its very difficult, its just .. maybe everyone does it on its own just in a few hours time and then forgets it, and nobody cares enough to make good demos for it.

There are global listeners in InteractionManager if you need it (in renderer.interaction stuff)

Here's full code for interaction manager: https://github.com/pixijs/pixi.js/blob/dev/packages/interaction/src/InteractionManager.js ,the main algo t is in `processInteractive ` method.

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...