Hi all,
This problem has partly evolved from another thread, but I’ve made a bit of progress and need a little (more) advice.
I have a waypoint drawing system that works within a limited “drawRegion”, then you click this region it adds a new dot, you click again and it draws another and adds a line between them. The dots instances have their own mouse behaviour (draggable) and the lines are children of the dot instances.
The problem is that the last dot extends a line to the mouse tip and when you click, it bubbles up and acts as a click on the dot parent, causing it;s drag behaviour and moving it to current mouse location.
I wanted the lines to be ignored by clicks, they have no behaviour and the drawRegion itself needs to know if the user clicked on blank space or a dot.
I have added some behaviour to the lines so they enact my drawRegion.MouseDown method (generates new dot).
After provisionally testing all of this I realised it won’t work, essentially there will ALWAYS be a line directly under the mouse cursor and will therefore never reach the dot-drag action. Which leads me to thinking about some horrid method that finds if the mouse is over a dot or not, basically wasting all the lovely provided methods.
I have tried fiddling with mouse disabling and mouseChildren and also bubble/capture booleans on the event listeners themselves… but I’m not sure I can get these planets to align.
Is there a way to make a sprite permeable to mouse clicks? So it will instead register as a click on whatever is (visually) “behind” the line beneath the cursor? Or will I have to code something so the line never extends all the way to the mouse cursor? Or just write something that manually sees what the cursor is over?
Any help is gratefully received…