I just got the newly upstreamed Picking plugins to work! Currently I have a sprite with a click observer, and a child of that sprite with a similar click observer
// One parent and one child, does not need
// to be right on top of eachother for this
// "click propagation" to occur.
commands
.spawn(...)
.observe(|e: Trigger<Pointer<Click>>, ...| { println!("Parent clicked"); })
.with_children(|parent| {
parent
.spawn(...)
.observe(|e: Trigger<Pointer<Click>>, ...| { println!("Child clicked") });
});
This system works fine. If we press the parent only "Parent clicked" will be printed. However if we decide to click the child element, both print statements are run. Is there any way of disabling click propagation for the child component? (So when we click the child, only "Child clicked" will be displayed). Thanks in advance :)