Game Development Community

TextListCtrl and Strings

by Robert Norris · in Torque Game Engine Advanced · 01/12/2006 (9:24 am) · 3 replies

Hi,

i think this is a real beginner problem, but i can't find the answer.

I use some GuiTextListCtrl elements in several GUIs without problems.
Now i've implemented an ingame statistic panel, which can be displayed by holding the tab key. I use two GuiTextListCtrl elements in this panel und here is my problem:
Numerical values are display in black (fontcolor), but strings are displayed in a light gray (in the same row). I use the GuiTextArrayProfile and tried to change some values, but nothing works.

The other GuiTextListCtrl elements i use display strings in black, but not my ingame statistic panel...

Any comments here?

regards
rob

P.S.: some code:

This is one of my GuiTextListCtrl elements

new GuiScrollCtrl(){
	profile = "GuiClashScrollProfile";
	horizSizing = "right";
	vertSizing = "bottom";
	position = "440 160";
	extent = "300 300";
	minExtent = "8 8";
	visible = "1";
	helpTag = "0";	
	willFirstRespond = "1";
	hScrollBar = "alwaysOff";
	vScrollBar = "alwaysOff";
	constantThumbHeight = "0";
	defaultLineHeight = "15";
	childMargin = "0 0";
	
        new GuiTextListCtrl(GSGui_ListAlienStats) {
	        profile = "GuiTextArrayProfile";
		horizSizing = "right";
		vertSizing = "bottom";
		position = "440 160";
		extent = "300 300";
		minExtent = "300 300";
		visible = "1";
		enumerate = "0";
		resizeCell = "1";
		columns = "0 30 200 250";
		fitParentWidth = "1";
		clipColumnText = "0";
		noDuplicates = "false";
	};
};

and here is my update functions body

%data[0] = %soHumanData;
	%data[1] = %soAlienData;
	
	%lists[0] = GSGui_ListHumanStats;
	%lists[1] = GSGui_ListAlienStats;
	
	for(%i = 0; %i < 2; %i++){
		%lists[%i].Clear();
		for(%j = 0; %j < %data[%i].count; %j++){
			%name = GetWord(%data[%i].array[%j], 0);
			%kills = GetWord(%data[%i].array[%j], 1);
			%flags = GetWord(%data[%i].array[%j], 2);
			echo("Entries:" SPC %name SPC %kills SPC %flags);
			%lists[%i].addRow(
				%j,
				%j + 1 TAB 
				%name TAB 
				%kills TAB 
				%flags,
				%j);
		}
		%lists[%i].setSelectedRow(-1);
	}
	
	
	if(!GameStatisticGui.isVisible()){
		GameStatisticGui.setVisible(true);
		GameStatisticGui.setActive(true);
	}

#1
01/17/2006 (12:32 am)
Hm... look at the Screenshot, perhaps my probem becomes more clearer...

www.syncrage.de/GG_images/statistcP.jpg
As you can see, the rank-, kills- and flagscore entries are written in black, but the name entry is written in a light grey. I don't know why...
#2
01/17/2006 (12:50 am)
That's a mean thing ;)
The player names are "tagged" in Torque, which basically means extra info is added to the string (color information etc.)

Try to "detag" your %name var with something like this:

%rawName = stripChars( detag(%name), "\c8" );
This should remove the additional color information and make your name black...
#3
01/17/2006 (8:06 am)
That's it! Thank you Stefan! :)