Moving a stack with no controls
Klaus on-rev
klaus at major.on-rev.com
Thu Jul 19 14:39:21 EDT 2012
Hi Skip,
Am 19.07.2012 um 20:35 schrieb Magicgate Software - Skip Kimpel:
> I have a stack that has a custom shape so that when it runs it has a
> transparent background. Since it has no controls at the top as you
> would normally have in a main stack, is there a way to allow the user
> to drag and move the stack around the screen at run time?
put this into the card or stack script:
################################
local maydrag
on mouseDown
put mouseH() & "," & mouseV() into maydrag
end mouseDown
on mouseMove
if maydrag is not empty then
set the topLeft of this stack to item 1 of the screenMouseLoc - item 1 of maydrag,item 2 of the screenMouseLoc - item 2 of maydrag
end if
end mouseMove
on mouseUp
put empty into maydrag
end mouseUp
on mouserelease
mouseup
end mouserelease
################################
Will do what you need :-)
Best
Klaus
--
Klaus Major
http://www.major-k.de
klaus at major.on-rev.com
More information about the use-livecode
mailing list