Torque3D Documentation / _generateds / GuiMessageVectorCtrl

GuiMessageVectorCtrl

consoledoc.h

A chat HUD control that displays messages from a MessageVector.

More...

Public Attributes

Public Functions

bool

Push a line onto the back of the list.

void

Stop listing messages from the MessageVector previously attached to, if any.

Detailed Description

A chat HUD control that displays messages from a MessageVector.

This renders messages from a MessageVector; the important thing here is that the MessageVector holds all the messages we care about, while we can destroy and create these GUI controls as needed.

// Declare ChatHud, which is what will display the actual chat from a MessageVector
new GuiMessageVectorCtrl(ChatHud) {
   profile = "ChatHudMessageProfile";
   horizSizing = "width";
   vertSizing = "height";
   position = "1 1";
   extent = "252 16";
   minExtent = "8 8";
   visible = "1";
   helpTag = "0";
   lineSpacing = "0";
   lineContinuedIndex = "10";
   matchColor = "0 0 255 255";
   maxColorIndex = "5";
};

// All messages are stored in this HudMessageVector, the actual
// MainChatHud only displays the contents of this vector.
new MessageVector(HudMessageVector);

// Attach the MessageVector to the chat control
chatHud.attach(HudMessageVector);

see:

MessageVector for more details on how this is used

Public Attributes

string allowedMatches [16]
int lineContinuedIndex 
int lineSpacing 
ColorI matchColor 
int maxColorIndex 

Public Functions

attach(MessageVector item)

Push a line onto the back of the list.

Parameters:

item

The GUI element being pushed into the control

// All messages are stored in this HudMessageVector, the actual
// MainChatHud only displays the contents of this vector.
new MessageVector(HudMessageVector);

// Attach the MessageVector to the chat control
chatHud.attach(HudMessageVector);

return:

Value

detach()

Stop listing messages from the MessageVector previously attached to, if any.

Detailed description

Parameters:

param

Description

// Deatch the MessageVector from HudMessageVector
// HudMessageVector will no longer render the text
chatHud.detach();