THis is some code from a project i worked on like two years ago. It�s
designed to snap a sprite to a pre defined point if you have draged it close
enough to be inside a specified rect. Since i�ve cut it out of a 37+ meg
large project, where it was set scrolling under a mask. i dunno if it�s able
to run like it is but it will help to point you in the right direction.
<SWEDISH> Vart jobbar du? </SWEDISH>
--CODE SNIPPET
    aStartLoc = sprite(ScrollMem2).member.regPoint --sets the dragSprites
current        regpoint as startPoint (could be called on museUp
    aGoalLoc = point(x,y)--the snap to point
    movePoint = aStartLoc - aGoalLoc --defines the distance to move the
sprite hor/vert
    partMove = movePoint / 4 --set 4 waypoints
    partMove = partMove--dunno why i included this =)
    if sprite(ScrollMem2).member.regPoint <> aGoalLoc then --checks to see
if ur done
      sprite(ScrollMem2).member.regPoint =
sprite(ScrollMem2).member.regPoint - partMove
      updateStage --updates stage to be sure it�s showing
    end if
--END SNIPPET

Hope this helps point you in the right direction.

Ta ta
/Micke

____________________________________________
Mikael Wir�n
Knowledge Network
Klubbacken 30
129 39 H�GERSTEN
Tel: +46-(0)8-646 24 31
Mob: +46-(0)709-15 24 30
Mail: [EMAIL PROTECTED]
Web: HTTP://www.knowledgenetwork.se
____________________________________________


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Sofia Hjulin
> Sent: den 11 september 2001 23:05
> To: [EMAIL PROTECTED]
> Subject: <lingo-l> drag and drop and snap
>
>
> Hello!
>
> I�m new on the list. I�m from sweden so pardon my english!
>
> I�d like som help with a drag and drop function I got som
> problem with.
> A sprite shall (when draged in the snapping area) snapp to
> coordinats. When
> the item has snapped shall
> an other thing happend.
>
> Do you have an example for me?;)
>
> /Zapata
>
>
> [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!]
>
>


[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!]

Reply via email to