Animation - Erasing a Sprite
Deus Ex Machina

Hi,

I was wondering if anybody could expain this:

To keep it simple, say I want to move a 10 x 20 rectangle around on the screen. If I try to erase it with a 10 x 20 rectangle of the background color, I get a "trail" in the path of motion.

I can deal with this okay by making the erasing rectangle a bit bigger, but it doesn't make sense to me logically. If I draw a rectangle of the background color of exactly the same size, in exactly the same place the moving rectangle was, shouldn't it obliterate it?

Thanks,

Jim

Paul whoknows

If my understanding is correct, a double buffer system is what you need.

Neil Black

Are you moving it before erasing? Make sure you're erasing the right spot.

Slartibartfast

Make sure you Erase->Move->Draw->Render.
Also, you're drawing and erasing to a single bitmap, right?
And if you can't fix it yourself, some code might help. (using [ code ] tags and showing only relevant code)

Neil Black
Quote:

Make sure you Erase->Move->Draw->Render.

Yeah, that's what I was trying to say.

Thread #593658. Printed from Allegro.cc