Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:TextEditBoxSetTextColor

From RoR Wiki

UI Lua API · TextEditBox functions
Version: WAR 1.4.8

Sets the text colour of a TextEditBox.

TextEditBoxSetTextColor(editBoxName, r, g, b)

Arguments

editBoxName
string – Name of a TextEditBox window.
r, g, b
number – Colour components, 0–255. Cut to whole numbers.

Returns

Nothing.

Details

  • The colour is stored as fractions of 255. Alpha is always set to fully opaque.
  • The new colour is applied to the text straight away.

Errors

  • Error in function call 'TextEditBoxSetTextColor': Window %s does not exist
  • Error in function call 'TextEditBoxSetTextColor': Window %s is not a TextEditBox

Example

Colouring the chat input in the current channel's colour, from ea_chatwindow/source/chatwindow.lua:

function EA_ChatWindow.UpdateTextEntryChannelColor(channelColor)
    TextEditBoxSetTextColor ("EA_TextEntryGroupEntryBoxTextInput", channelColor.r, channelColor.g, channelColor.b)
    ...
end

See also