On Mon, Sep 15, 2008 at 10:14:51AM -0500, John Wise wrote:
> I may be dense but is there a way to slowly draw a line or circle, ala
> logo or scratch (http://scratch.mit.edu/)
Sure, you'll need to involve an animate block. Draw portions of the
shape a bit at a time and then stop the animation when it's done.
Shoes.app do
nofill
strokewidth 4
@anim =
animate 20 do |i|
@circle.remove if @circle
rads = i * (PI * 0.01) # draw 1% of the circle each frame
@circle = arc 70, 70, 100, 100, 0, i * (PI * 0.01)
@anim.remove if rads >= TWO_PI
end
end
Although I wonder if this sort of animation could be wrapped up in a
method. Sort of like the undocumented `tween` method.
_why