How do I avoid clickthrough?
I'm sure this question has been asked and answered but I couldn't find it.
Say I have two active objects that are overlapping. They both have the same qualifier. If the player clicks on the top object where it overlaps the bottom object, the event line affects both objects. How do I prevent this?
(I'm starting to think about a card game and I don't want multiple cards in a stack to be affected by me clicking on the bottom card.)
Re: How do I avoid clickthrough?
If UserClicksOnObject>Active
+ MouseOverObject>Active
+ Active-IsOverlapping>Active =
Active.Destroy
I took that guess but if it doesn't work then sorry I would know no further although to know that this should be possible.
Re: How do I avoid clickthrough?
You could use the Select Object extension to select only the frontmost object.
Re: How do I avoid clickthrough?
Thanks for the replies. I think the easiest solution will be to use the y coordinate of the card on the bottom. Since I know that the bottom card of my stack is at a y position of, say, 161 I can simply do this:
If user clicks on Card1
+Card1 Y position = 161
[Do Something]
That seems to work, even where there are multiple active objects underneath the one I'm clicking on. (As long as they are offset, of course.)