Game Development Community

MessageVectors

by Craig Vincent · in Torque Game Builder · 02/08/2007 (9:04 am) · 2 replies

Still trying to learn how to problem deal with the GUI...my latest quirk is with the Message Vectors. I setup the appropriate GUI controls (afaik)

new GuiScrollCtrl(chatTextScroll) {
canSaveDynamicFields = "0";
Profile = "GuiScrollProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "7 315";
Extent = "657 251";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
willFirstRespond = "1";
hScrollBar = "alwaysOn";
vScrollBar = "alwaysOn";
constantThumbHeight = "0";
childMargin = "0 0";

new GuiMessageVectorCtrl(commandVector) {
canSaveDynamicFields = "0";
Profile = "GuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "2 2";
Extent = "634 228";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
lineSpacing = "0";
lineContinuedIndex = "10";
matchColor = "0 0 255 255";
maxColorIndex = "9";
};
};

new MessageVector(commandConsole);
commandVector.attach(commandConsole);

no errors/warnings.

However then if I try to populate the Message Vector

function message(%this) {
commandConsole.pushFrontLine(%this, 0);
}

message("Test message");

no errors again however no text appears.

Anyone have any ideas/suggestions as to what I may be doing wrong?

#1
02/10/2007 (9:06 am)
Anyone...anyone....bueller?
#2
02/10/2007 (5:34 pm)
function message(%this) {
      commandConsole.pushFrontLine([b]%this[/b], 0);
}

To call the '%this'statememnt you should have a function on the objects namespace you want to reffer to. In this case, for example:

function [b]MyObject[/b]::message(%this) {
      commandConsole.pushFrontLine([b]%this[/b], 0);
}