Hi, AgateLib seems really cool. That said, I have a little question. When making sprites, I like to use magenta (programmer's pink) as the transparent color. I can't find how to set this as the transparent color when blitting. Thanks in advance! |
|||
|
|
|
AgateLibAwesome Game and Tool Engine Library |
|
|
|
AgateLib doesn't have the
AgateLib doesn't have the concept of a color key that you see in an API like DirectDraw. This is mainly because no such concept exists in Direct3D or OpenGL. The best thing to do is to save your images in a format with an alpha channel, like png and use real transparency. This also has the advantage of allowing partial transparency.
What you can do is load the file in AgateLib and replace the your transparent color with a color with alpha transparency:
Do that once when you first load the surface and areas intended to be transparent will be so when drawn. It will slow down loading somewhat, so if reasonable you should do the conversion manually ahead of time so the conversion doesn't have to be done each time images are loaded.
Thanks so much for the prompt
Thanks so much for the prompt reply. Works great!
Tom