API:WindowSetFontAlpha
From RoR Wiki
UI Lua API · Window functions
Version: WAR 1.4.8
Sets the alpha (opacity) of the text of a window and all of its descendants.
WindowSetFontAlpha(windowName, alpha)
Arguments
- windowName
string– Name of the window.- alpha
number– New font alpha, from 0 (invisible) to 1 (opaque).
Returns
Nothing.
Details
- Values below 0 are stored as 0 and values above 1 as 1.
- The same value is written to the window and to every descendant, replacing their own font alpha. Unlike WindowSetAlpha, the value is not multiplied by the parent's.
- If the window itself already has this font alpha, nothing happens, and its descendants are not updated either, even if some of them have a different value.
- The window alpha set with WindowSetAlpha is separate. To fade a window including its text, set both.
- The function needs at least two arguments and only reads the last two.
Errors
Error in function call 'WindowSetFontAlpha': Window %s does not exist
Example
Fading a tooltip, window and text together, from easystem_tooltips/source/tooltips.lua:
function Tooltips.SetTooltipAlpha( alpha )
WindowSetAlpha( Tooltips.curTooltipWindow, alpha )
WindowSetFontAlpha( Tooltips.curTooltipWindow, alpha )
end
