VBGamer |
|
RE: 8 Bit Transperancies and Use of Masks....Help Corre (0 replies, 0 views) (2000-Sep-15) 256 color bitmaps use a palette of 256 colors. Every pixel in the bitmap have an index into this palette. Example: The white (255,255,255) color of a bitmap might be placed as the third color in the palette. Every pixel in the bitmap that are white will have the pixel value 3, not the pixel value 255,255,255, as it would have in 16 or 24 bit. Because of this, you set the colorkey differently in 8 bit mode. Instead of doing:
key.low = TransCol
key.high = TransCol
you do:
key.low = Index
key.high = Index
Where Index is the color that should be transparent (with the example above, this would be set to 3).
Masks are not really used in DirectX (they COULD be used, but colorkeying is easier).
An alternative to using 8 bit mode is to use 16 or 24 bit mode, but keep all sprites and other resources 8 bit. This way it wouldn't take any more diskspace, but each bitmap would be able to have it's own 256 color palette.
/Corre, MiCo Games
http://www.micogames.com |