I'm creating a sketch where multiple ellipse objects created in a for() loop can be dragged around & dropped onto each other into a stack. When one object is dragged over another it grows larger and snaps to the same x&y position.
I've got it working as far as the dragging and overlap-checking goes, however when an object overlaps one that has been created earlier it jumps on top of it, hiding it(because it grows larger) . Is there a way to set the depth of an object without using transform/anything else that would require me to change my sketch to P3D etc?
- I've just spotted the header in the processing.js page - this is almost what I am trying to achieve, except that I would like to be able to drag the object out of the 'stack' again & I'd rather not just rip off this example.
Any suggestions? - I only discovered dist() and angleBetween() today so I might just be missing YET ANOTHER fundamental function. Thanks, L.
I have a series of rollover buttons arranged in a ring. The ring can be moved around the screen, but wherever it is, the actual spots that trigger the rollover-effect are always stuck in one place.
the applet can be found here: here. It's easy to see the problem, but confusing for a beginner to work out how to solve.
I think it is connected to the way I am moving my object (the ring of buttons) using translate(), because its screen location (0, 0) moves around when dragged with the mouse.
- can anyone suggest a way to make both parts of the buttons line up?
- or even a way to find out the 'real' x & y for my object when it thinks it is at (0, 0) but has been translated?
Thanks! L.