[GOODIE] Animation Morph

Jim Benson jb at speed.net
Sun Feb 17 17:00:34 UTC 2002


Sorry, this is a resend with a better tag on the title so it ends up in the
Squeak archive. This version even has attachments!!

After re-reading the literature, one of the most fun things that is missing
in Squeak from the Morphic Self environment is the cartoon like animations.
So I coded a couple of parts up, and started playing around. It's pretty
interesting, and adds a lot of fun to Squeak.

I also noticed when I was playing with the OSX Macs in the store that there
was a
little 'poof' animation in the Dock when an app is expanded. I knew
that I didn't have a similar 'poof' animation in Squeak.

I felt forsaken. I was worried that I was being left behind. The state of
the art had advanced, and I wasn't a part of it. I felt that I couldn't even
look at myself in the mirror anymore.

Then it came to me in a dream. *I* could code up a 'poof' animation !!! Life
was worth living again!

Here it is. AnimationMorph.st is the code for the animation. Basically you
code up your animation as frames arranged in a vertical strip and store them
in a Form. This Form then becomes the image of the Animation morph. There is
an example in AnimationMorph class>>explode. If you're really adventurous,
file in the closeBoxHit code. If you file this in, then every time you close
a SystemWindow the magic explode animation appears. The AnimationMorph is
pretty big when you decompress the file (around  400K), but that's mostly
just the explode animation form.

One tasty bit is that the frame of the animation is displayed within the
extent of the AnimationMorph, so that you can scale your animation to fit
into a given area. If you open your explode AnimationMorph and set the
extent to: 256 at 256, then the animation fills that area.


Enjoy,

Jim Benson







-------------- next part --------------
A non-text attachment was scrubbed...
Name: SystemWindow-closeBoxHit.st.gz
Type: application/octet-stream
Size: 487 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020217/2e7fa4d5/SystemWindow-closeBoxHit.st.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AnimationMorph.st.gz
Type: application/octet-stream
Size: 21048 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020217/2e7fa4d5/AnimationMorph.st.obj


More information about the Squeak-dev mailing list