new angle prop

Phil Davis phildavis at attbi.com
Wed Apr 24 05:23:01 EDT 2002


Try this - it works:


-- card script

on mouseMove
  -- an "aim" checkbox turns it on/off
  if the hilite of btn "aim" = false then exit mouseMove

  put (the mouseH - (item 1 of the loc of img 1)) into x
  put (the mouseV - (item 2 of the loc of img 1)) into y
  set the angle of img 1 to ((atan2(x,y) *180) / pi) - 90
end mouseMove

(I forgot to use the 'mouseMove' params - if you do, that'll make it yours!)

My "angle" test stack is at http://home.attbi.com/~phildavis/mc/angle.mc .

Phil

----- Original Message ----- 
From: "Klaus Major" <kmajor at metascape.org>
To: <metacard at lists.runrev.com>
Sent: Wednesday, April 24, 2002 12:24 AM
Subject: new angle prop


> Hi lovely list,
> 
> 
> there is this wonderful new property for images "angle".
> 
> Can someone eventually supply a smart script to do the following ?
> 
> Supposed i have an image of an arrow (i actually do :-).
> 
> What should i script in a "mousemove"-handler to make that arrow
> always point to the cursor ?
> 
> I know that i have to calculate the appropriate angle from the images loc
> and the mouseloc. But how ?
> 
> No, i wont use "mouseloc" but "x,y" that are supplied with the mousemove 
> function ;-)
> 
> A code-snippet would be heavily appreciated.
> 
> Thanks in advance.
> 
> 
> Regards
> 
> Klaus Major
> kmajor at metascape.org
> 
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard




More information about the metacard mailing list