Advertisement

Multiple colorkeys

Started by August 01, 2000 01:11 PM
12 comments, last by krompo 24 years, 4 months ago
how do I use multiple colorkeys in directdraw''s FastBlt? I want to avoid using masks. I use isometric diamond style engine(exactly as in civ2).One color represents the diamond and another color the rest of the tile rectangle (rectangle-diamond). thank you for any advice. krompo
krompo
You only need one colorkey per image. A colorkeyed area is made invisible so why do you need 2 different colored areas made invisible? But what I believe you are trying to do is make different areas of the image invisible at different times. This can be done. When you blit the image, just use a different colorkey mask, however you cant make both invisible at the same time, only 1 or the other. So if you trying to make a tile, then also want a tile outline which can be turned off or on, then you have to use a seperate image for the tile and the tile outline.

Possibility
Advertisement
the problem is that there are 2 colors in the image that
need to be invisible. I could use only one color, but
I use the second color for better orientation.
Do you get what I mean? First color represents the actual
diamond shape. The rest (rect-diamond) is a different
color only because I want to recognize the diamond shape
in order to know, where to draw to. How do you guys solve
this problem? Oh, all this I mean when I want to draw
a layer like a tree, or gold sign. Of course, when
I want to draw entire grassland, I only need one color
for the rect-diamond shape.

I would add appropriate .gif file, but I don''t know
how to add graphics into this message. Should I use
common html code?




krompo
krompo
Yup use normal HTML < IMG SRC="www.mypage.com/myimage.gif" >
Take out the spaces and add your own address and it''ll work.

You should never need more than one transparent colour, and more than one starts to slow it down more, as it has to check for a larger number of colours. In DX you have an upper and lower transparent colour and everything in bettween those is also transparent.
So if for some reason you REALLY, REALLY need more than one colour, use Black (0,0,0) and 1 shade off of Black (1,1,1)

Then use a range of 0,0,0 to 1,1,1. Then those and anything in between those would be transparent.

But you shouldn''t need to, I''ve never seen any commercial or home made game that need more than one transparent colour.
Explain a bit more, maybe we can help you get that extra colour outta there!
- Ben
__________________________Mencken's Law:"For every human problem, there is a neat, simple solution; and it's always wrong."
"Computers in the future may weigh no more than 1.5 tons."- Popular Mechanics, forecasting the relentless march of science in 1949
thats true u wont need more than one colour for transparency.
noone can see the differnce between 0,0,0 and 1,0,0. though if u want to have some of the texture transparent and some of it semitranparent use an alpha channel with the texture




krompo
krompo
Advertisement



krompo
krompo
well, now it works.
As you can see, there are two color I need to make transparent.
well, that''s what I thought I need. But how do you make it
without using 2 colorkeys? This problem only occurs when
I want to blit higher layers, when I blit grassland or jungle,
what is primary layer, the tile in that case covers entire
pink area so I need only the gray colorkey. But how
to solve it in this case?



krompo
krompo
If you are using Photoshop or paintshop pro you could make the diamond shape on a layer then draw your item or grass tile on another layer above the diamond shape layer and the colorkey on another layer just beneath the diamond shape layer.

Then when you save just hide the diamond shape.

I hope it helped.
That banana is from civ2 right? Recognized it immidiatley

Dunno how they did in civ2, what I do know is that civ2 wasn''t created in directx, it uses WinG, and maybe they have some support for multiple colourkeys..
Diemonex Games

This topic is closed to new replies.

Advertisement