constrained drag

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
MCla
Posts: 11
Joined: Sat Feb 20, 2010 5:37 am

constrained drag

Post by MCla » Fri Feb 26, 2010 6:28 pm

Any suggestions on how to implement a constrained drag. As in Iphoto 9, when you can drag a small rectangle in a large thumbnail to drive the part of the image to displayed in a larger frame. Clearly the button border cannot extend outside of the image area...

I intend to use a button with border and transparent fill (responds to mousedown) overlayed to an image object.

thanks

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

Re: constrained drag

Post by bn » Sat Feb 27, 2010 12:26 am

Hi MCla,
http://forums.runrev.com/phpBB2/viewtop ... f=9&t=4937
I posted a stack that has among other things constrain a drag to in that case the card, but you could use some of that code and adapt it.
the part pertaining to the drag constrains is marked in the script of the grc which lets you drag the marked objects around/the grey "field" in the middle
regards
Bernd

Post Reply