Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:WindowSetRelativeScale

From RoR Wiki

UI Lua API · Window functions
Version: WAR 1.4.8

Multiplies a window's scale by a factor.

WindowSetRelativeScale(windowName, factor)

Arguments

windowName
string – Name of the window.
factor
number – Value to multiply the window's current scale by.

Returns

Nothing.

Details

  • The window's new scale is its current scale (WindowGetScale) times factor.
  • Every descendant then gets the window's new scale as its absolute scale, the same as with WindowSetScale. The descendants' previous scales are not multiplied.
  • The scale changes on every call, so calling it twice with 2 scales the window by 4.
  • Unlike WindowSetScale, there is no check for an unchanged value.
  • The function needs at least two arguments and only reads the last two.

Errors

  • Error in function call 'WindowSetRelativeScale': Window %s does not exist
  • Error in function call 'WindowSetRelativeScale': Window %s is currently locked and may not be modified from lua. ...
    This check never triggers in the current client. See WindowSetShowing.

Example

From easystem_glyphdisplay/source/glyphdisplay.lua:

--may have been resized with layout editor...
local newWidth, newHeight = WindowGetDimensions(self.windowName)
local scaleFactor = newWidth / DEFAULT_CONTAINER_WIDTH
WindowSetRelativeScale( self.windowName, scaleFactor )

See also