Lua Chat System — Client API — ChatBar
Lua Chat System — Client API — ChatBar
The ChatBar handles client-side text entry for the Lua Chat System. There are two key components of the ChatBar:
- ChatBar, a
TextBox
, where the player inputs messages and commands (highlighted in orange) - MessageMode, a
TextLabel
, which can display information about the message being sent (highlighted in green)
Methods
GetTextBox
- Parameters: None
- Description: Returns the
TextBox
of the chat bar. - Returns:
TextBox
GetMessageModeTextLabel
- Parameters: None
- Description: Returns the MessageMode
TextLabel
. - Returns:
TextLabel
IsFocused
- Parameters: None
- Description: Returns whether the chat bar’s
TextBox
is in focus (player is typing in box). Equivalent to callingTextBox/IsFocused
on the result of GetTextBox. - Returns: bool
CaptureFocus
- Parameters: None
- Description: Forces the client to focus on the
TextBox
of the chat bar. Equivalent to callingTextBox/CaptureFocus
on the rsult of GetTextBox. - Returns: void
ReleaseFocus
- Parameters: bool
submitted = false
- Description: Releases the focus of the chat bar
TextBox
. Ifsubmitted
is true, this will behave as if the player pressed Enter to submit the message. - Returns: void
ResetText
- Parameters: None
- Description: Sets the
TextBox/Text|Text
of the chat barTextBox
to the empty string. - Returns: void
SetTextBoxText
- Parameters: string
text
- Description: Sets the
TextBox/Text|Text
of the chat barTextBox
to the giventext
. - Returns: void
GetTextBoxText
- Parameters: None
- Description: Returns the text in the chat bar
TextBox/Text
. - Returns: string
SetTextLabelText
- Parameters: string
text
- Description: Sets the
TextLabel/Text|Text
of the MessageModeTextLabel
to the giventext
. - Returns: void
GetEnabled
- Parameters: None
- Description: Returns whether the chat bar is
GuiObject/Visible|Visible
. - Returns: bool
SetEnabled
- Parameters: bool
enabled
- Description: Sets whether the chat bar is
GuiObject/Visible|Visible
. - Returns: void
SetTextSize
- Parameters: int
textSize
- Description: Sets the
TextLabel/TextSize|TextSize
of both the chat bar’sTextBox
and MessageModeTextLabel
. - Returns: void
ResetSize
- Parameters: None
- Description: Resets the size of the chat bar to one line of text.
- Returns: void
SetChannelTarget
- Parameters: string
channelName
- Description: Sets the target ChatChannelUI given its
channelName
to which the chat bar should submit messages. - Returns: void
FadeOutBackground
- Parameters: float
duration
- Description: Fades out the background over the given
duration
in seconds. Note: later calls to control fading in/out will override earlier calls. - Returns: void
FadeInBackground
- Parameters: float
duration
- Description: Fades in the background over the given
duration
in seconds. Note: later calls to control fading in/out will override earlier calls. - Returns: void
FadeOutText
- Parameters: float
duration
- Description: Fades out the text over the given
duration
in seconds. Note: later calls to control fading in/out will override earlier calls. - Returns: void
FadeInText
- Parameters: float
duration
- Description: Fades in the text over the given
duration
in seconds. Note: later calls to control fading in/out will override earlier calls. - Returns: void