"Snapping" method

Ender Nafi Elekcioglu endernafi at keehuna.com
Sat Jan 25 08:49:07 EST 2014


Peter hi,

This is actually Bernd’s or Scott’s expertise,
but I wanted to give it a shot.

I don’t use dropbox, google drive or any other file sharing service.
So, I uploaded a sample stack to the forums:
http://forums.runrev.com/viewtopic.php?f=22&t=18910#p95292

It’s a quick attempt and has many, many drawbacks.
I’m sure there are more elegant ways to accomplish this.

But it’s a start, hope you find it useful.


Best,

~ Ender


From: Peter Bogdanoff Peter Bogdanoff
Reply: Peter Bogdanoff bogdanoff at me.com
Date: January 25, 2014 at 10:11:30
To: How to use LiveCode use-livecode at lists.runrev.com
Subject:  "Snapping" method  
Hi,  

Before I go ahead and try to reinvent the wheel, does anyone know of a method for this:  

I have 2 or more buttons separated on a card. I drag one around, or resize it. When the border of that button gets close to the border of another button (like within 5 pixels), the dragged button is magnetically attracted--snapped--to the second button, so that its border attaches to the border of the other button, their borders aligning--the right of one aligning with the left of the other.  

I see that there is a grid setting in the LiveCode preferences that controls this kind of motion when controls are moved with the mouse, but I don't want controls to align to an arbitrary grid but to each other. (The reason for this is that there is an image underneath that the buttons are being aligned over and that can be at any pixel on the card.)  

Thanks for any advice...  

Peter Bogdanoff  
UCLA  

_______________________________________________  
use-livecode mailing list  
use-livecode at lists.runrev.com  
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:  
http://lists.runrev.com/mailman/listinfo/use-livecode  



More information about the use-livecode mailing list