🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Allegro and transparency

Started by
2 comments, last by whiteLightning 23 years, 7 months ago
I was wondering how you can set a certain color as transparent when using the allegro graphics library. I''m makina a platform game and i want the background to show through my sprites. What should I do?
Advertisement
If you''re using 8 bit mode, you''ll need to make the transparent areas filled with the color 0 (this is 0 as in palette index). If you''re using true color modes, you''ll need to make the transparent areas bright pink (r = 255, g = 0, b = 255).

instead of using blit, you''ll need to use draw_sprite.

Hope that helps.
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
Hey, thank you very much, i''ll try that out!
I''ll just add that you can use masked_blit() instead of draw_sprite(), if you want.

==================
/* todo: insert cool sig */
Martee
Magnum Games.NET
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers

This topic is closed to new replies.

Advertisement