you could check for an intersection, and if there is one, move the new
sprite to the side of the sprite it's intersecting, by setting the left
of the new sprite = the right of the old sprite + a few. that kind of thing.
or you can have them end up where you want by setting the loc of the new
sprite to the loc of the old sprite plus some offset.
sprite(me.spriteNum).loc = sprite(otherSprite).loc+ point(x, y)
where x and y are hardcoded, or are calculated based on the
intersection, or the width of the old sprite, or any other way.
HTH,
bhakti
stephanie wrote:
>
> Can anybody help?
> I am using the lingo code below to lock a sprite in place if it is dragged
> to the correct sprite. My probelm is that it locks the dragged sprite in the
> center bottom of the target sprite and i would like to be able to change
> this and specify were it ends up as If i drag more than one sprite to the
> target then they sit on top of each other.
>
> Thanks in Advance
> Stef
>
> on lockInPlace me , otherSprite
> if (sprite(otherSprite).member.type = #text) and
> (sprite(me.spriteNum).member.type = #text) then
> -- if both are text, then loc the sprite to the upper right corner
> loc = point(sprite(otherSprite).rect.right,
> sprite(otherSprite).rect.top)
> else
> -- if not text, then lock both sprites exactly together
> -- and leave spacing up to the registration points
> sprite(me.spriteNum).loc = sprite(otherSprite).loc
> end if
> end
>
> [To remove yourself from this list, or to change to digest mode, go to
> http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
> email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
> Lingo-L is for learning and helping with programming Lingo. Thanks!]
--
R. Bhakti Klein
Educational Software R & D
http://www.DLWorkshop.net
��
Baritone, unaffiliated but open to suggestions...
���
"On Earth, you can only do little things;
but you can do them with a lot of Love."
-- Mother Theresa
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]