2D Game Dev – Part 7.1: Bitmap Transparency in Allegro 5

This post is a portion of Part 7 in my on going series about 2D Game Development using the Allegro 5 library. These posts are in course order. You can see all of the posts in this course by clicking the “2D Game Development” button at the top of this site.

In this video we will be looking at two different ways to achieve transparency in our loaded bitmaps. We have the option to either load an image that already has a transparent background, like a PNG, or use the function al_convert_mask_to_alpha.

Full source can be found here

Posted in 2D Game Dev, Allegro, C++, Code, Game Dev, Part 7, Tutorial
7 Comments » for 2D Game Dev – Part 7.1: Bitmap Transparency in Allegro 5
  1. Thanks for the share!
    Hellen

  2. Mirek says:

    The published video is only 1:26 minutes long – not complete

  3. Zephy says:

    Hey Mike I have a question about the picture weird.png, when I open it in paint it looks different from when I see the thumbnail and if you open it in paint you`ll notice theres some blue at the bottom and a black box surrounding the blue color line. The thing I don’t get is that isn’t anything black suppose to show up to and the blue at the bottom as well? it looks like it just shaped the whole image, unless does the black count as the one being invisible and the white is just already invisible? thanks if you can explain it, liking the series and I am learning alot :) since I can’t get into college and study due to it being full.

  4. Frefro says:

    The source code archive isn’t complete, you wrote some frames of the dragon in the source, which are not present in the archive.
    Also frames are not explained in your video.

    • Mike says:

      I have a source code archive?

      Also, what do you mean that I don’t teach frames?

      • Raul says:

        He means that you have mixed the next part code with this one. On the Transparency2.cpp source code you have the code that makes the animation move.

        I took the liberty of combining the two methods described on this video in order to achieve transparency here’s a link: http://goo.gl/RvUSz just in case Frefro or other user finds itself lost with the resources associated with this video.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • RT @danawhite: Zombie is BAD ASS!!!!! 1 day ago
  • I really wish I could move with WASD in Diablo 3 2 days ago
  • Well, #diablo3 servers are down... why do I need servers to play single player again? 2 days ago
  • Installing D3. By my powers combined! 2 days ago
  • My calendar just beeped with "Lunch thing, bring chips". No location or desc. I obviously don't care about future me that much. 3 days ago