Opacity/alpha channel on text, how?
When you define a color using RGB you could attach an alpha channel to add transparency. My question is how to achieve this on text when using the "|c" formatting option?
If I would set the color of an entire label to red I could do like this: Code:
myLabel:SetColor(255, 0, 0) -- equivivalent of hex code FF0000 Code:
myLabel:SetText("|cFF0000" .. myText .. "|r") Code:
myLabel:SetColor(255, 0, 0, 0.5) -- equivivalent of hex code FF0000 with 50% transparency Code:
myLabel:SetText("|cFF00007F" .. myText .. "|r") Code:
myLabel:SetText("|cFF0000|7F" .. myText .. "|r") BR, w33zl |
Controls have an additional method SetAlpha(a). Note that values for SetAlpha as well as SetColor should be in the range <0; 1>.
|
AFAIK color code can't have transparency. All you can do is as merlight suggested use myLabel:SetAlpha(0.5).
As for the hexadecimal color code - default ZO_ColorDef object works with ARGB, i.e.: 7FFF0000 Lua Code:
But still as I said above, transparency in the color code will be ignored, value of myText will be "|cFF0000Hello World!|r". |
Quote:
Quote:
|
All times are GMT -6. The time now is 12:54 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI