UltimateChatBox

The UltimateChatBox class is the main component of this Asset.

Important Note: Each of the provided public method examples require a public UltimateChatBox variabled named: chatBox.

Since the UltimateChatBox class is within the TankAndHealerStudioAssets namespace, you will need to add the using statement at the top of your scripts where you want to reference the chat box.

using TankAndHealerStudioAssets;
Method
Description

Registers chat information to the Ultimate Chat Box to be displayed.

Enables the chat box.

Disables the chat box.

Clears the entire chat box of all entries.

Enables the input field so that the player can input text.

Toggles the state of the input field.

Disables the input field so that text cannot be input by the player.

Sends custom input values to the Ultimate Chat Box to process.

Returns all the chats that have been registered with the targeted username.

Returns all the registered chats that are using the provided style.

Updates the position of the chat box on the screen.

Event
Description

Callback for when a chat has been registered to the chat box.

Callback for when a new username has been hovered by the player.

Callback for when the player has interacted with a username.

This event is called when the input field of the chat box has been updated.

This event is called when the input field of the chat box has been submitted.

This event is called when the input field is updated and contains a potential command.

This event is called when the input field is submitted and contains a potential command.

This event is called when the extra image associated with the input field has been interacted with.

Properties

Property
Description

IsEnabled

The current state of this Ultimate Chat Box being enabled or disabled.

Interactable

The current state of the chat box being interactable. Setting this value to false will not allow input to be processed on the chat box.

LineHeight

The line height of the TextObject to use for chat box navigation and chat spacing.

AllTextObjects

The list of all the text objects that have been created to display the registered chat information.

ChatInformations

The list of all the registered chat informations.

InputOnChatBox

Returns the state of the input being on the chat box or not.

InputPosition

The stored position of the input for calculating on the chat box.

GetButtonDown

The state of the input being down on this frame for calculations.

GetButton

The current state of the input being pressed.

ScrollValue

Set the current scroll value to apply to the chat box.

TotalChatBoxSize

The total size that the chat box occupies on the screen. This value includes the input field if that is used.

BaseTransform

The base transform of the Ultimate Chat Box.

VisibleChatBoundingBox

Returns the RectTransform that is used as the visible mask for the chat box.

ChatContentBox

Returns the RectTransform that contains the text objects for the chat box.

TextObject

Returns the TextMeshPro GameObject used as the basis for all the chats in the chat box.

TextColor

The color of the text in the chat box. Assigning a value here will update all the text in the chat box.

CalculatedFontSize

Returns the calculated font size based off the user defined Smart Font Size percentage.

InteractableUsernameImage

The image component of the username highlight.

InteractableUsernameColor

The color of the interactable username image. Assigning a value here will update image if there is a username currently being hovered over.

UsernameHighlighted

The current state of the player hovering over a username in the chat box.

CurrentHoveredChatIndex

The index of the ChatInformation that is currently being hovered.

LeaveTextVisible

Determines if the text inside the chat box should remain fully visible even when the chat box itself is disabled.

EmojiAsset

Returns the assigned TextMeshPro sprite asset.

ScrollbarActive

The current state of the scrollbar being visible or not.

InputField

The input field component used in connection with the chat box.

InputFieldEnabled

InputFieldValue

The current string value of the input field.

InputFieldContainsCommand

Returns if the current input field value contains a command value or not.

ExtraImageSprite

The sprite associated with the extra image.

ExtraImageColor

The extra image color.

EmojiWindowEnabled

Returns the current state of the emoji window being enabled and interactable.

EmojiButtonSprite

The sprite of the emoji button on the chat box.

EmojiButtonColor

The color of the emoji button on the chat box.

Class Name
Description

Stores all the information about the chat inside the chat box.

Contains all the variables needed for a style that can be applied to a chat.

Last updated