Moving & "Magnetizing" vector objects

Want to talk about something that isn't covered by another category?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
gedkins
Posts: 2
Joined: Fri Aug 20, 2010 1:28 am

Moving & "Magnetizing" vector objects

Post by gedkins » Fri Aug 20, 2010 1:36 am

I used Hypercard years ago to mock up interfaces on a regular basis - I mourned its demise. I now have need to mock (ASAP) a new interface and RunRev is just the ticket - but I need some help.
What I would like to do is have some rectangular blocks (from a tear off palette ultimately) that can be dragged around on a card and when it is dropped near an existing rectangle it snaps along side it as if it was magnetic. If then I select the linked blocks they would travel together, unless say I had a shift key down then I could break the bond.

I am sure there a way to mimic this characteristic - can anyone offer some simple scripts to get me under way again. It may be riding a bike, but I am quite rusty and I could sure use the training wheels to get me on the right path.

TIA

Guy

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: Moving & "Magnetizing" vector objects

Post by bn » Tue Aug 24, 2010 12:44 am

Hi Guy,
welcome to the forum.

What you are asking is not quite that simple as the scripts get quite involved with your specs.
I gave it a try since I liked to try this and append a stack that implements the features you had in mind (no palette, no tear off of graphics). Other might do it differently but here it goes.

See how far you get and ask the forum if you get stuck.

regards
Bernd
Attachments
SnapToLocII.rev.zip
(4.24 KiB) Downloaded 344 times

gedkins
Posts: 2
Joined: Fri Aug 20, 2010 1:28 am

Re: Moving & "Magnetizing" vector objects

Post by gedkins » Wed Aug 25, 2010 7:05 pm

Bernd,

This is great and pretty much what I was looking for - I think I can tweak my way through on this now. Really liking Rev at this point. Thanks again for the big leg up on this problem.

Regards,

Guy

hliljegren
Posts: 111
Joined: Sun Aug 23, 2009 7:48 am
Contact:

Re: Moving & "Magnetizing" vector objects

Post by hliljegren » Sun Aug 29, 2010 1:13 pm

I would do it as a substack for the palette and then as I drag them to the main window I would add the rectangles to a group. Then when you select the object you move the group and if you have shift down you break the object from the group and move it as a single unit.
___________________________________
MacBook Pro M1 MAX 64 Gb,
LiveCode 10.0.1rc3

Post Reply