Well not anymore, thanks to a new property
passThrough
, when set to true
it will let the event flow to the next available target, taking into consideration that targets may be groups, shapes, outlines and images. All targets now have that property too in case you are wondering. A quick example is in order, the next pic will show 4 rectangles and a star nested in a single group, the group has two mouse handlers (enter & exit), the star has four mouse handlers ( enter, exit, press & release ), whenever the mouse enters the group the star will change color to white, when it exits it will change color to black. When the mouse enters the star it will change color to cyan, and violet when the mouse is pressed, returning to its previous color when the reverse mouse action is triggered. By the way, the group has a set of filters applied
What does the code look like?
Perhaps you have seen in a previous example that the input events had a
sourceShape
property, but with the recent updates that name no longer makes sense, so it has been updated to target
. Notice also that the group references the star by its nested index (I'm thinking in adding a local set of variables if an id
is defined), as a matter of fact this trick works for all operations that accept nesting of others.Keep on Groovying!