I'm trying to detect collisions with objects in a group and I have two problems:
1. When I try to move the group around, it moves only one object in the group, the one I click down on. The group consists of two buttons, each with an icon assigned. I need the group to move as a single unit.
2. I actually only want collisions to be detected on one of the objects in the group. Is this possible?
Regards,
Devin Asay
Groups and collisions
Moderators: heatherlaine, kevinmiller, robinmiller, malte
-
- Livecode Opensource Backer
- Posts: 107
- Joined: Mon Apr 10, 2006 7:02 pm
- Location: Provo, Utah, USA
- Contact:
Groups and collisions
Devin Asay
Learn to code with LiveCode University
https://livecode.com/store/education/
Learn to code with LiveCode University
https://livecode.com/store/education/
Re: Groups and collisions
Hi Devin,
1) Is a little tricky (I still need to set up a demo stack for that), as the group only receives the relevant messages if it is opaque. Demo stack will follow during the course of next week.
2) is a lot simpler. If you set up the collision listener, do not make the group listen for collisions, but instead the object contained in the group.
Hope that helps,
Malte
1) Is a little tricky (I still need to set up a demo stack for that), as the group only receives the relevant messages if it is opaque. Demo stack will follow during the course of next week.
2) is a lot simpler. If you set up the collision listener, do not make the group listen for collisions, but instead the object contained in the group.
Hope that helps,
Malte
-
- Livecode Opensource Backer
- Posts: 107
- Joined: Mon Apr 10, 2006 7:02 pm
- Location: Provo, Utah, USA
- Contact:
Re: Groups and collisions
Thanks for the reply, Malte. I still couldn't get the group to move, but decided it was easier just to use more traditional methods (mouseDown, mouseMove handlers) to control the dragging. I was able to listen for collisions on a single object in the group, just as you suggested.
Devin
Devin
Devin Asay
Learn to code with LiveCode University
https://livecode.com/store/education/
Learn to code with LiveCode University
https://livecode.com/store/education/