So i got a really basic yet really good question. See if you can do this!
What I am trying to do is have the user drag one object and as that object moves horizontally, a separate group moves accordingly. For the sake of this example, It can be as simple as moving a red square with your finger and having a group of blue squares move accordingly to the red square. When I say accordingly i mean if you drag the red square over 30 pixels the group with the blue squares will move 30 pixels in the same direction at the same speed.
So looking at the available livecode functions that can be used I think it can be done with: touchmove, mousemove, move, but most likely movecontrol. Although i have not used the movecontrol function before and am not sure how to go about using it. Any insights to how I would go about this would be much appreciated. Also, nothing has been posted yet about the moveControl function so it would be great if someone was able to share their experience. Thank you.
-Will
See if you can do this! moving groups around a stack
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 212
- Joined: Fri Feb 01, 2013 1:31 am
- Contact:
Re: See if you can do this! moving groups around a stack
Hi,
Of course this is what groups are for, but if they did not exist at all, I made three buttons. In button 1 I wrote:
Craig Newman
Of course this is what groups are for, but if they did not exist at all, I made three buttons. In button 1 I wrote:
Code: Select all
on mouseDown
repeat with y = 1 to 3
set the startX of btn y to item 1 of the loc of btn y
end repeat
end mouseDown
on mouseMove
if the mouse is down then
put the startX of me - item 1 of the mouseLoc into xOffset
repeat with y = 1 to 3
set the loc of btn y to the startX of btn y - xOffset & "," & item 2 of the loc of btn y
end repeat
end if
end mouseMove
-
- VIP Livecode Opensource Backer
- Posts: 212
- Joined: Fri Feb 01, 2013 1:31 am
- Contact:
Re: See if you can do this! moving groups around a stack
Youre right! Thank you fro answering that question for me. I am going to post a similar question now about being able to move an object smoothly while sending messages. Please take a look at my new post. Thank you for your help dunbarx! you really got me on the right track!