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.
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.
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.
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)
gifs can't be translucent like I described, they can only be transparent.
I'm useing the tga format.
Create sub-bitmaps of the main bitmap:
create_sub_bitmap
Don't forget to destroy the sub-bitmaps before the main one.
cool, that works great, cat!
If I rotate the bitmap, will there be a problem about translucency?
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.
maksed_blit skips the keycolor, he wants translucency = alpha