Drag group

Monte Goulding monte at sweattechnologies.com
Sun Jan 12 17:41:01 EST 2003


Hi

I missed Scotts reply so I don't know exactly how you are doing this but if
you are setting the loc of the group and using the mouseMove technique then
all you need to do is work out the relative location of the mouse to the loc
of the group when you first mouseDown. So you might do womething like:

local lRelativeLoc,lMouseDown

on mouseDown
  put the mouseH-item 1 of the loc of this group,the mouseV-item 2 of the
loc of this group into lRelativeLoc
put true into lMouseDown
end mouseDown

on mouseMove x,y
  if lMouseDown then
    set the loc of this group to x-item 1 of lRelativeLoc,y-item 2 of
lRelativeLoc
  end if
end mouseMove

on mouseUp
 put false into lMouseDown
 ...

Cheers

Monte

>
> Thanks Scott,
>
> It took a lot of cutting and fitting, but I have the dragging of my
> little horizontal group working beautifully.
>
> One problem has me stumped.
>
> I put a series of buttons (7) into the group, which I can now drag
> horizontally, and pass all kinds of messages to. What frustrates me now
> is that when I hover over or click on any given button, all is well;
> but once I move the mouse to drag, the buttons jump under the mouse so
> that the dragging takes place on the centre of the group. I would like
> the cursor to remain over the point that I moused down onto.
>
> I suppose I could place the drag script inside each button, but then I
> would have no room for my button scripts, and I do find the idea of
> building within 10 lines particularly elegant.
>
> Could you suggest some solution? Later on I hope to drag up to 20
> images in this way.
>
> Ryno.
>
> My background is in fine art, mostly figurative work:
> http://users.iafrica.com/s/sw/swartart
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list