API:ColorPickerGetTexDims
From RoR Wiki
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 existError 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
