2D Sprite Color
Blitz3D Forums/Blitz3D Beginners Area/2D Sprite Color
| ||
Hello all. I've been ever-so-slowly designing a 2D RPG, that will hopefully turn into a graphical MUD at some point. That point is far off! Inch by Inch, I'm getting there though. I'm using the Gimp to create graphical 32x32 tiles (Linux/Unix fax) and they look okay. However, I then decided to make a sprite and drew up a little purple wizard (sort of looks like a blob with big button eyes) on a transparent background. When I loaded the image into my code, all black lines were completely transparent! Anyone know if something in the way Blitz3D loads the image that causes this? Or perhaps this has something to do with the way I'm making the sprites. Anyway, back to trying to make the poor guy a bit less blob looking. I'm very much a newbie but am getting together a website that will go through each of my steps in a tutorial/worklog type format. Will keep all posted. Thanks for the help. |
| ||
I think black is the default transparency mask value. |
| ||
Hello John, Thanks for the help... that's sort of what I figured. I changed all black to 10% gray and now the wizard looks fine. I say fine, not good... anyone know of a good tutorial on how to draw up 2D sprites? ;-) I'm too stubborn to not create my own! |
| ||
If you're using an alpha channel, and using blitz 3d, set the texture's blend mode to alpha rather than mask. Then you can use black. (And alpha channels, which are way cool) |
| ||
If you want true black to NOT be transparent, then you need to use the command: MaskImage handle,red,green,blue. (Its description follows:) Blitz Basic assumes that when you load an image (using LoadImage or LoadAnimImage) for drawing (using DrawImage command), you want the color black (RGB color 0,0,0) on your image to be transparent (or see through). There WILL come a time when you want some other color to be that masked color. so... Determine a particular shade of color that you will NEVER use, and set that to be your background transparent color (perhaps some shade of purple?) This means your sprite graphics drawing program will have that particular RGB color value set for its default background for your sprites. Then, because you are not using rgb 0,0,0 as your transparent background color, you are free to use true black in your program. |
| ||
Graphics |
| ||
Hmmm. 2D game in B3D? If you are using 2D sprites, what Sir Gak said will help. If you are using 3D sprites, pay attention to Anthony Flack. |