Game Development Community

GuiTextCtrl and arrays

by Daniel Kochlowski · in Torque Game Builder · 03/16/2006 (7:10 am) · 1 replies

Hi,

does anybody know if it is possible to use a field of an array as variable for a GuiTextCtrl?

new GuiTextCtrl(highScoreEntryName) {
canSaveDynamicFields = "0";
Profile = "GuiHighScoreTextProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "48 0";
Extent = "145 40";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
internalName = "highScoreEntryName";
hovertime = "1000";
maxLength = "1024";
variable = "highScoreObject.score[0]";
};

highScoreObject is a ScriptObject. If I do it this way the control does not show anything.
Do I have to use a global variable as workaround?

Thanks in advance

About the author

Recent Threads


#1
03/16/2006 (10:31 am)
Yes I'm pretty sure I recall the variable support being pretty primitive here, supporting only globals. I was trying to use an object's field at one point and couldn't get it to work so I scanned through the source and saw that it has some assumptions on how it interprets the variable text (e.g. doesn't seem to go through the standard variable name script compilation stuff).

This was awhile ago though, things could have changed (including my recollection ;) so you may want to take a look at the latest source just in case.