[Newbies] Is there an easy way to implement an animation loop?

karl ramberg karlramberg at gmail.com
Thu Jan 5 17:00:25 UTC 2012


Hi
In morphich you should use the step method.

Just add a step method to the morph and start the stepping when you want
the animation to start.
I think you must add a self changed or a self layoutChanged at the end of
the step method to update the morph.

It's a little more difficult to block all other morphs from update thou.
But if they run animation, you can stop their stepping and start it again
when your animation is done.

Morphic runs in a single process and using other processes will
not necessarily give trouble.

You set the desired time between steps with method stepTime and return
the millisecond time you would like.

Karl

On Thu, Jan 5, 2012 at 2:15 PM, Jan Teske <
jan.teske at student.hpi.uni-potsdam.de> wrote:

> Hi there,
>
> I try to implement a blocking animation so that the process waits for the
> animation to be terminated before going ahead. This animation should lower
> the extent of a Morph in 20 iterations so that it looks like it would
> shrink.
>
> I tried to accomplish that in a '1 to: 20 do:' loop but the Morph is not
> updated during the iterations. I tried 'morph changed' but that doesn't
> work either. It does work, however, if I fork the animation loop. But than
> I have an extra process an need Semaphores to wait for its execution.
> That's not as simple as it could be.
>
> Is there any better way than fork and Semaphore? Maybe some force redraw
> method I have overlooked?
>
> Thanks in advance!
> ______________________________**_________________
> Beginners mailing list
> Beginners at lists.**squeakfoundation.org<Beginners at lists.squeakfoundation.org>
> http://lists.squeakfoundation.**org/mailman/listinfo/beginners<http://lists.squeakfoundation.org/mailman/listinfo/beginners>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20120105/c232d735/attachment.htm


More information about the Beginners mailing list