suggestions for animation with alpha value?
Alex Hanson-White

Hi,
I'm a bit confused with how to go about blitting a section of a tga file which has alpha values, because the way to blit a transparent image only allows you to draw the whole thing..
Am I overlooking something?
How would I go about blitting a section of a translucent image, and not the whole thing?

Thanks.

Christopher Bludau

if it's not possible to blit only a part of the image you could save the animation in different files.

anim_01
anim_02
anim_03

and so on.

Then just blitt the diffrent images.
I do it this way.

Alex Hanson-White

yeah, i figured that would be possible, but I'm wondering if there is an alternative where you can keep the frames all in 1 file.

Murat AYIK

You can load one tga file and create individual memory bitmaps using it. Mapping the right alpha values is an easy task.
(edited for clarification)

Dustin Dettmer
Alex Hanson-White

gifs can't be translucent like I described, they can only be transparent.
I'm useing the tga format.

Kitty Cat

Create sub-bitmaps of the main bitmap:
create_sub_bitmap
Don't forget to destroy the sub-bitmaps before the main one.

Alex Hanson-White

cool, that works great, cat!

tapir

If I rotate the bitmap, will there be a problem about translucency?

Alex Hanson-White

I wanted to do just that, so I went and tried it, tapir.
rotate_sprite works, it keeps the alphas and evrything.
What you gotta make sure to do is draw/rotate it onto a new bitmap, and then draw the new bitmap instead of the sub_bitmap.

BAF

What about

? That allows you to draw transparent stuff...

tapir

maksed_blit skips the keycolor, he wants translucency = alpha

Thread #556586. Printed from Allegro.cc