Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:WindowSetTintColor

From RoR Wiki

UI Lua API · Window functions
Version: WAR 1.4.8

Sets the tint colour of a window and all of its descendants.

WindowSetTintColor(windowName, r, g, b)

Arguments

windowName
string – Name of the window.
r, g, b
number – Red, green and blue on a 0–255 scale. 255, 255, 255 means no tint.

Returns

Nothing.

Details

  • The values are divided by 255 and stored without clamping.
  • The same colour is applied to the window and to every descendant, replacing their own tint.
  • If the window already has this tint, nothing happens, and its descendants are not updated either.
  • The tint's alpha part is taken from the window's current alpha; this function does not change opacity.

Errors

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

Example

Greying out a coin icon, from easystem_resourceframes/source/moneyframe.lua:

if greyOut == true then
    WindowSetTintColor(imageWindow, DefaultColor.MEDIUM_GRAY.r, DefaultColor.MEDIUM_GRAY.g, DefaultColor.MEDIUM_GRAY.b)
else
    WindowSetTintColor(imageWindow, DefaultColor.ZERO_TINT.r, DefaultColor.ZERO_TINT.g, DefaultColor.ZERO_TINT.b)
end

See also