getChatboxLayout | Multi Theft Auto: Wiki Skip to content

getChatboxLayout

Client-side
Server-side
Shared

Returns information about how the chatbox looks.

Syntax

​mixed getChatboxLayout ( [ ​string CVar = nil ] )
Optional arguments

Note: when using optional arguments, you might need to supply all arguments before the one you wish to use.

  • CVar (default: nil): The name of the property you want returned.
    • chat_font: Returns the chatbox font
    • chat_lines: Returns how many lines the chatbox has
    • chat_color: Returns the background color of the chatbox
    • chat_text_color: Returns the chatbox text color
    • chat_input_color: Returns the background color of the chatbox input
    • chat_input_prefix_color: Returns the color of the input prefix text
    • chat_input_text_color: Returns the color of the text in the chatbox input
    • chat_scale: Returns the scale of the text in the chatbox
    • chat_position_offset_x: Returns the x position offset setting
    • chat_position_offset_y: Returns the y position offset setting
    • chat_position_horizontal: Returns the horizontal alignment setting
    • chat_position_vertical: Returns the vertical alignment setting
    • chat_text_alignment: Returns the text alignment setting
    • chat_width: Returns the scale of the background width
    • chat_css_style_text: Returns whether text fades out over time
    • chat_css_style_background: Returns whether the background fades out over time
    • chat_line_life: Returns how long it takes for text to start fading out
    • chat_line_fade_out: Returns how long takes for text to fade out
    • chat_use_cegui: Returns whether CEGUI is used to render the chatbox
    • text_scale: Returns text scale
    • chat_text_outline: Returns whether text black/white outline is used

Returns

  • A table of all CVar values, if CVar was not specified.
  • A bool if chat_use_cegui was entered.
  • A number(s) if any other CVar was specified.
  • false if an invalid CVar was specified.

Returns a bool, table or number.

  • mixed: result

Code Examples

client

This code makes the chatbox empty when you type /clear.

addCommandHandler("clear", function()
local lines = getChatboxLayout()["chat_lines"]
for i = 1, lines do
outputChatBox("")
end
end)

See Also

GUI Functions