Reference Source Test
public class | source

Chat

Manages the game's chat log window and chat history

Constructor Summary

Public Constructor
public

constructor(game: Game)

Default constructor

Member Summary

Public Members
public

button: DOMElement

Jquery reference to the chat button

public

chat: DOMElement

Jquery reference to the chat container

public

The duration before the chat message starts to fade out

public

A reference to the timeout for the chat message

public

Instance of the game object

public

input: DOMElement

Jquery reference to the chat input element

public

log: DOMElement

Jquery reference to the chat logs container

public

The visibility of the chat containers

Method Summary

Public Methods
public

add(label: String, text: String, labelColor: String, textColor: String): *

Add a chat message

public

clean(): *

Reset the fade timeout

public

hideChat(): *

Hides the input box for entering chat messages into

public

hideInput(): *

Hide the chat input boxes

public

Returns true if the input box has focus and is currently active or being typed into

public

key(keyCode: Number): *

Respond to key enter key presses for chat messages

public

send(): *

Send chat messages to the server via sockets

public

showChat(): *

Show the chat messages box

public

showInput(): *

Show the input box for entering chat messages into

public

toggle(): *

Toggle if they chat UI is visible or not

Public Constructors

public constructor(game: Game) source

Default constructor

Params:

NameTypeAttributeDescription
game Game

instance of the game class

Public Members

public button: DOMElement source

Jquery reference to the chat button

public chat: DOMElement source

Jquery reference to the chat container

public fadingDuration: Number source

The duration before the chat message starts to fade out

public fadingTimeout: Object source

A reference to the timeout for the chat message

public game: Game source

Instance of the game object

public input: DOMElement source

Jquery reference to the chat input element

public log: DOMElement source

Jquery reference to the chat logs container

public visible: Boolean source

The visibility of the chat containers

Public Methods

public add(label: String, text: String, labelColor: String, textColor: String): * source

Add a chat message

Params:

NameTypeAttributeDescription
label String

info in front of the message

text String

the message text

labelColor String

the color of the label

textColor String

the color of the message text

Return:

*

null

public clean(): * source

Reset the fade timeout

Return:

*

null

public hideChat(): * source

Hides the input box for entering chat messages into

Return:

*

null

public hideInput(): * source

Hide the chat input boxes

Return:

*

null

public isActive(): Boolean source

Returns true if the input box has focus and is currently active or being typed into

Return:

Boolean

public key(keyCode: Number): * source

Respond to key enter key presses for chat messages

Params:

NameTypeAttributeDescription
keyCode Number

the code for the key that was pressed

Return:

*

null

public send(): * source

Send chat messages to the server via sockets

Return:

*

null

public showChat(): * source

Show the chat messages box

Return:

*

null

public showInput(): * source

Show the input box for entering chat messages into

Return:

*

null

public toggle(): * source

Toggle if they chat UI is visible or not

Return:

*

null