Transparency with tga images
I have a problem with making transparency work with tga images. What I have is a control with tga background image displayed on top of a window. The window background is 10% transparent so I'd like that the rounded corners of the tga image blend with the window background. At the moment I'm using 100% black corners which isn't too bad, but it isn't optimal.
I've toyed with the tga alpha channel (making corners black and such) and all the different blending modes but so far I haven't found a combination that would work the way I want. What usually happens is that the corners 'burn' a hole through the window, the image disappears completely, or the whole image burns a hole through the window. Has anyone else encountered this problem and managed to make it work? -Chiran |
Not sure what you exactly mean. alpha layer is pretty straightforward as you probably know. black is transparent, white not, grey values somewhere between (there's lots of guides to can google about it).
In some rare cases I have noticed if you have a couple of targa files overlapping each others the part where they cross might not show the transparency at all. This applies to skinning however, no idea if it's same with your own LUA windows. Perhaps up a few screenshots of your problem for us to see and that might help with locating the problem. |
Yes, I can post some pictures later.
Anyway, clearly I can make the corners transparent. But the problem is that it doesn't show the underlying window background under the corners. Instead, the game graphics shine through the corners. -Chiran |
Here's a few example images.
Left: black button corners and 10% transparent window background (no alpha channel in the tga) Middle: transparent corners, game graphics shining through Right: Using Overlay blend mode, corners blend with window background but the underlying quickslot shines through (yeah it's a bit complicated heh) The images are 300% zoomed so left and right images don't look that bad in-game. -Chiran |
And you tried to use same grey value on those corners in button files as you have on your background (not sure if you mean Overlay Blend term for this) ?
I'm gonna download your plugins to check the files and see if I could help that way. It looks a bit like a bug |
Does your button alpha layer look like this (I downloaded the current Songbook that didn't have an alpha layer at all like you said) ?
|
Quote:
In those test images the window background is the default black window background with 0.9 window opacity value. And the corners on the middle and right test image alpha channel are 90% white (rgb 230,230,230) while the rest of the image is 100% white. I'm not exactly sure if it's even supposed to work like that. -Chiran |
I think I had a similar problem with alpha blending a custom control with a custom TGA. What I finally did was set the backcolor of the control to the same color as the parent. So in my case, I have a window with a button on it.
Code:
self:SetBackColor(self.bgColor); Have you tried the same? Edit: Another possible way is: self.toggleButton:SetBackColorBlendMode(Turbine.UI .BlendMode.Undefined); Edit2: You need to make sure you use self.toggleButton:SetBlendMode(Turbine.UI.BlendMod e.AlphaBlend); at the same time as the above line. |
Quote:
-Chiran |
try
Code:
element:SetBlendMode(Turbine.UI.BlendMode.AlphaBlend) |
Quote:
-Chiran |
All times are GMT -5. The time now is 08:05 AM. |
vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI