"Azinger, Richard" wrote:
> 
> Hello list,
> 
> Dir 8 - Shockwave
> 
> ...Now the problem, when
> the user clicks on the sprite that he/she want and drags it to the work area
> the sprite is suppose to stay with the mouseLoc. If they move to fast the
> sprite doesn't stay with the mouse but moves parallel with it (offset). 

Does it stay offset even after the user stops going too fast?


>...Also
> if the mouse is to close to the edge of the stage when he/she does a mouseUp
> then the sprite doesn't take it's rightful place on the stage. 
<shuffle text>
> on mouseUp me
>   if sprite(the clickOn).rect.union(rect(145,5,445,269)) =
> rect(145,5,445,269) then
>...

Is there an 'else' at the end of this? If not, then there's nothing
handling the condition where the sprite has been dropped outside of the
expected area.


>...When the
> mouseUp occurs the sprite goes to the mouseLoc usually but it is very
> distracting on the mouseDown.

As in: when you first click on the sprite it jumps to the cursor?
to avoid that, record the 'offset' between the mouseloc and the sprite's
loc and add or subtract that from the movement of the sprite relative to
the mouse.

>... I added a enterframe with a stillDown event 

If you don't have other animation or heavy processing going on you could
try this:

<skeletal-psuedo-code>

on mousedown me
  record the mouse-sprite offset
  do mouseDown activities

  repeat while the mousedown
    spriteloc = mouseloc +or- mouse-sprite offset
    updateStage
  end repeat

  -- from here on it's essentially a mouseUp handler
  do mouseUp activities
end

This works fine so long as you don't mind the world stopping while the
user moves the sprite around.

-- 
Carl West    [EMAIL PROTECTED]
617.262.8830 x246    

I have no superfluous leisure; my stay must be
stolen out of other affairs; but I will attend you awhile.

           - Isabella, Measure for Measure, Act 3 Scene 1

[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