Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ColorPickerGetTexDims

From RoR Wiki
Revision as of 19:41, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · ColorPicker functions
Version: WAR 1.4.8

Returns the texture size used for one colour swatch of a ColorPicker.

texWidth, texHeight = ColorPickerGetTexDims(colorPickerName)

Arguments

colorPickerName
string – Name of the ColorPicker.

Returns

texWidth, texHeight
number – Size of the swatch image in the texture, in texels.

Details

  • The value comes from the <ColorTexDims x="…" y="…"/> element of the ColorPicker's XML definition. Without that element both values are 0.
  • There is no Lua function to change it.
  • The stock UI never calls this function.

Errors

  • Error in function call 'ColorPickerGetTexDims': Window %s does not exist
  • Error in function call 'ColorPickerGetTexDims': Window %s is not a ColorPicker

Example

For the ColorPicker in default/ea_chatwindow/source/chatoptionswindow.xml, which has <ColorTexDims x="24" y="24" />:

local w, h = ColorPickerGetTexDims( "ChatOptionsWindowColorPicker" )   -- 24, 24

See also