Trouble with graphics display in OS X

Ken Ray kray at sonsothunder.com
Tue Jan 11 23:07:51 EST 2005


On 1/11/05 9:12 PM, "James Hurley" <jhurley at infostations.com> wrote:

> on mouseUP
>    set the loc of grc "ball" to 100, 100
>    put .1 into dx
>    put .1 into dy
>    put the loc of grc "ball" into tBallLoc
>    repeat 5000
>      add dx to item 1 of tBallLoc
>      add dy to item 2 of tBallLoc
>      set the loc of grc "ball" to tBallLoc
>      --wait 1 millisec
>    end repeat
>    set the loc of grc "ball" to 100,100
> end mouseUP

James, I'd suggest using "move" instead. If you can create the path line
using the points of a polygon, and then use "move", it is a lot smoother and
easier to control. For example, I made the ball, grabbed the freehand tool
and made a convoluted curvy line that would fit in a 500x500 square, hid it,
and then issued this:

on mouseUp
  move grc "ball" to the points of grc "path"
end mouseUp

and it was really smooth. It took a while (10 secs or so - my path was
really convoluted), so I decided I wanted it done in 3 seconds. So I did
this:
 
on mouseUp
  move grc "ball" to the points of grc "path" in 3 seconds
end mouseUp

Voila! 

If you can't use a path graphic, you can also use the other variations of
the "move" command to get what you want, I'm sure.

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list