[comp.sys.mac.programmer] Animation!

es1o+@andrew.cmu.edu (Eric Mitchell Snider) (04/05/88)

     Ok, here's another problem I'd like some help with.  I'm working
on a program where several small objects move around in front of a
background.  The problem is I don't know a good way to replace the
background after my objects have been erased and moved.  At the
moment everything (including the background) is a separate picture
(PICT) resource.  What do I need to do?!?

                              Eric

bm1q+@andrew.cmu.edu (Benjamin Jameson McCurtain) (04/10/88)

> (how to animate with PICT resources..... )

Hoo boy....  Well, first of all, if you want any sort of speed at all,
you'll need to make these bitmaps.. And then you can use
CopyBits, which will be perfect for restoring the background
(use the xor mode twice, and the background will be
restored, try it on paper)

To make bitmaps from PICTS,  do a DrawPict ( or some such, I'm
not near any mac docs right now) on an off-screen bitmap..
To do that, make two bitmaps, one to save the current portbits, and
one for the new one ( your bitmap), then set portbits to the bitmaps
for your shapes, draw the picture here, and there you have it.

Then you're set to use copybits.  I can send specific code if anyone
requests it....

Ben McCurtain
bm1q@andrew.cmu.edu