I'm wondering if there is any possibility to draw png with transparent colors, so I can make something half-transparent. I've read this but I can't get anything to work. I also heard about alpng library but I don't know if it's able to load transparency too.
I'm using allegro 4.2.1
with the newest Dev-C++
.
Asked
Active
Viewed 1,551 times
1
1 Answers
1
You need to load a 32-bit image, call set_alpha_blender()
and then draw_trans_sprite()
. See this discussion. TGA is the only format that Allegro 4 supports natively that is sufficient for this task. Otherwise, you'll need to look into a PNG loader add-on.
You may also want to consider switching to Allegro 5 if you are just getting started. It has a much more modern API for this type of thing.

Matthew
- 47,584
- 11
- 86
- 98
-
I like allegro 4, and I think 5 is too simmilar to SDL. I like allegro for being so easy, and allegro 5 is much more complex than 4. anyway, thx for help. – noisy cat May 22 '12 at 12:26
-
And how about drawing on this tga? – noisy cat May 22 '12 at 12:28
-
I mean putpixel, rectfill aso. – noisy cat May 22 '12 at 12:28
-
I'm not sure what you mean by "drawing on this tga". (If you have another question, you should start a new question.) – Matthew May 22 '12 at 15:24
-
I solved it myslef, I meant drawing with alpha channel, how to COPY the alpha just like it is, and how to ADD colors. – noisy cat May 22 '12 at 15:29