Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:WindowGetAlpha

From RoR Wiki

UI Lua API · Window functions
Version: WAR 1.4.8

Returns a window's own alpha (opacity).

alpha = WindowGetAlpha(windowName)

Arguments

windowName
string – Name of the window.

Returns

alpha
number – The window's alpha, from 0 (invisible) to 1 (opaque).

Details

  • This is the value set with WindowSetAlpha (or by an alpha animation). It does not include the alpha of the parent windows, which the client multiplies in when drawing.
  • While an alpha animation runs (see WindowStartAlphaAnimation), the value changes every frame.

Errors

  • Error in function call 'WindowGetAlpha': Window %s does not exist

Example

Saving a window's settings before editing it, from easystem_layouteditor/source/layoutframe.lua:

-- Alpha
frame.m_originalAlpha = WindowGetAlpha( frame.m_sourceWindowName )

-- Scale
frame.m_originalScale = WindowGetScale( frame.m_sourceWindowName )

See also