GUIs with alpha-channel BG

Started by JpSoft, Thu 15/05/2008 12:55:31

Previous topic - Next topic

JpSoft

Trying to improve the overall appareance of the game interface, we decide to include translucent GUIs instead solid ones.

So, we create this image



You can check it, in case the error is in the image itself.

Then we put it as background image of the GUI, but the GUI controls also become translucents  ??? We tried with everything (since is the first time we work with alpha-channels) but there is no way to make the GUI translucent and the controls solid.

We create all the images with Photofiltre Studio. I posted this here since i believe is a script issue that could be solved (hopefully).

Thanks

Jp

PS If i posted this in the wrong place, just feel free to move it wherever it must be placed

.M.M.

Hmmm, that is strange... And did you just set GUI color on 0?

JpSoft

Yes, color and borders are set to 0. Also, the sprite was imported "leave as is" (i dont know if this is important, but i believe it is the correct way) The transparency of the GUI was not modified.

What i can´t understand is how the GUI control images looks translucents if they were imported as plain BMPs. Also, i save the image as a PNG without any filter (maybe the trouble is here???? there are too many posibilities to try all them)

NEW: Runing the game in full screen mode, the alpha channels are 100 %transparent  ??? ??? ??? but works fine when run in a window.

Jp (feeling frustrate with alpha-blended images)

.M.M.

Quote from: JpSoft on Thu 15/05/2008 15:40:18
Yes, color and borders are set to 0. Also, the sprite was imported "leave as is" (i dont know if this is important, but i believe it is the correct way).

Try to import your sprite with another filter, like top- left pixel (but this pixel must have your transparent color). Something should be here .

JpSoft

Since my computer dont support 32 bit colur (just 24 bits) alpha channels looks 100 transparent in a full screen mode (i tested it in 32 bit PCs and transparencys works great). It minds that a sub-routine must be added to change the sprite in case the colour depth is inadecuate to use solid ones. (i believe i remember something about a function to get the colur depth of the system, maybe Game.GetColourDepth or something)

Anyway, im still testing to get the wished effect im looking for (solid buttons in a translucent GUI)

Thanks for the reference.

Jp

Khris

You could use two GUIs on top of each other: one using the bg image and its transparency set to like 50, the second one on top, no background, bg color 0, holding the solid buttons.

JpSoft

I also thinked on that, but im pretty sure there must be another way to solve it.

Jp

naltimari

Quote from: JpSoft on Fri 16/05/2008 15:12:53
I also thinked on that, but I'm pretty sure there must be another way to solve it.

Hi, I would suggest you to include alpha channels on your buttons also, and selecting 'top-left pixel' when importing them.

To sum it up, it seems to me that to get what you want you need:

- A background with an alpha channel (even if it is opaque, it still must have an alpha channel)
- Button images with alpha channels (same as above)
- Background color set to 0 on your GUI
- Border color set to 0 on your GUI

Let me know if this works. I'm having my share of problems with alpha channels in GUIs, and I posted a thread about this two days ago in the technical forum, I suggest you follow that discussion.

[]s

SMF spam blocked by CleanTalk