Rammschnev Posted December 10, 2016 Share Posted December 10, 2016 I am working on a project in which the user creates a system of points by adding them one-at-a-time. These points are also draggable, and clicking on existing points sets the clicked point as active. That's all working fine. When using a simple mouseDownCallback, clicking one of these existing points creates interference between the activities of the new point and the old point. I want to be able to determine what sprites, if any, a clicked point contains and run a function only if the spot is unoccupied. If I can do this via the activePointer versus specifically mouse, that's preferred, but not necessary. Can someone point me in the correct direction? Link to comment Share on other sites More sharing options...
drhayes Posted December 12, 2016 Share Posted December 12, 2016 I don't know of a way to find out if no sprites were clicked. I can think of a couple of solutions? What if you had a big, invisible sprite that was behind all the other sprites, drawn in a black color so that it was invisible. If someone clicks that sprite then they didn't click any of the others (because they'd get the click notification)? Depending on how many sprites you have, you could also loop through each one and see if it was clicked by checking its bounds manually, as it were. For loops can be pretty fast. Link to comment Share on other sites More sharing options...
Recommended Posts