Page 1 of 1

constrained drag

Posted: Fri Feb 26, 2010 6:28 pm
by MCla
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

Re: constrained drag

Posted: Sat Feb 27, 2010 12:26 am
by bn
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