Mail Archives: djgpp/1998/04/18/00:33:01
Elias Pschernig wrote:
>
> >I've just barely gotten into animation
> >with Allegro. I'm trying to animate a man
> >walking by over a rather intricate background
> >image.
> >
> > If I don't erase the man after each frame,
> >he'll look like a solid streak across the
> >screen. (he's only advancing one pixel at a
> >time) I can't just print a black spot where
> >the old frame used to be, because I'd lose
> >my background image.
> >
> > I tried using create_sub_bitmap() to copy
> >the section of the background image that would
> >be changed, so I could print the "MAN" on the
> >screen, and clear him by using blit() like so:
> >
> >tempbmp=create_sub_bitmap(screen, x, y, 100, 100);
> >draw_sprite(screen, man, x, y);
> >vsync();
> >blit(temp, screen, 0, 0, x, y, 100, 100);
> >
> > And then, I repeat the process, changing x and y
> >to move the image....
> >
> > So, what'm I doing wrong? Any assistance
> >would be greatly appreciated.
> >
> >Thank you.
> >Anthony A. Tedjamulia
I think it's worth pointing out that create_sub_bitmap doesn't make a
copy, it just allows you to use a different area of the original bitmap.
- Raw text -