Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ScaleInterface

From RoR Wiki

UI Lua API · Interface functions
Version: WAR 1.4.8

Sets the overall scale of the user interface.

ScaleInterface(scale)

Arguments

scale
number – New interface scale factor.

Returns

Nothing.

Details

  • The new value replaces the current base scale and the interface is updated. The client then passes the ratio of the new scale to the old one to each child of the root window.
  • The client does not limit the value. The stock InterfaceCore.UpdateScale works the scale out from the screen resolution and the user's global UI scale setting, and keeps it between 0.25 and 1.25 before calling ScaleInterface.
  • Nothing happens if the root window does not exist yet.
  • Exactly one argument must be passed.

Errors

None besides the generic Invalid Parameters message when the argument is missing or not a number.

Example

From interfacecore/interfacecore.lua:

-- Sanity Check the End Result
local MIN_SCALE = 0.25
local MAX_SCALE = 1.25

if( scale < MIN_SCALE )
then
    scale = MIN_SCALE
elseif( scale > MAX_SCALE )
then
    scale = MAX_SCALE
end

ScaleInterface( scale )

See also