text in text list gets cut off
by Eaymon Latif · in iTorque 2D · 03/16/2009 (9:26 am) · 8 replies
some times in the GuiTextListCtrl gets cut off and i have to go into a level then come back to the screen to see the entire list again.
Has this happened to anyone? does any one know how to fix it ?
the font size is 14 or 18
the code:
new GuiScrollCtrl() {
canSaveDynamicFields = "0";
isContainer = "1";
Profile = "GuiScrollProfile";
HorizSizing = "relative";
VertSizing = "relative";
Position = "338 217";
Extent = "230 179";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
willFirstRespond = "1";
hScrollBar = "alwaysOff";
vScrollBar = "dynamic";
constantThumbHeight = "0";
childMargin = "0 0";
new GuiTextListCtrl(levelListCtrl) {
canSaveDynamicFields = "0";
isContainer = "1";
Profile = "GuiTextListProfile";
HorizSizing = "relative";
VertSizing = "relative";
Position = "2 2";
Extent = "226 5";
MinExtent = "8 5";
canSave = "1";
Visible = "1";
hovertime = "1000";
enumerate = "0";
resizeCell = "1";
columns = "0";
fitParentWidth = "1";
clipColumnText = "0";
};
};
Has this happened to anyone? does any one know how to fix it ?
the font size is 14 or 18
the code:
new GuiScrollCtrl() {
canSaveDynamicFields = "0";
isContainer = "1";
Profile = "GuiScrollProfile";
HorizSizing = "relative";
VertSizing = "relative";
Position = "338 217";
Extent = "230 179";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
willFirstRespond = "1";
hScrollBar = "alwaysOff";
vScrollBar = "dynamic";
constantThumbHeight = "0";
childMargin = "0 0";
new GuiTextListCtrl(levelListCtrl) {
canSaveDynamicFields = "0";
isContainer = "1";
Profile = "GuiTextListProfile";
HorizSizing = "relative";
VertSizing = "relative";
Position = "2 2";
Extent = "226 5";
MinExtent = "8 5";
canSave = "1";
Visible = "1";
hovertime = "1000";
enumerate = "0";
resizeCell = "1";
columns = "0";
fitParentWidth = "1";
clipColumnText = "0";
};
};
#2
03/16/2009 (1:47 pm)
For missing characters, it's most likely that your .uft don't have all the characters saved to it. iTGB reads in all characters from those files, and on Mac or PC, if it finds amissing char, will check the system fonts to find it, but the iPhone doesn't do that, so make sure your PC/Mac version generates full .ufts.
#3
03/16/2009 (2:01 pm)
Thanks, Mat. I created the fonts with writeFontCache. Is there a more thorough way to do this?
#4
What I did was make sure that I used every letter in the alphabet in my gui before calling writeFontCache(), the problem only shows up on characters that you haven't used before, which I found, was just in my player name, since that was entered in from the user. So I just make a player called abcdefhijklmnopqrstuvwxyz1234567890, then used the .uft generated after that.
03/16/2009 (2:43 pm)
Probably, but I don't know it. :P I think someone posted a resource a while back(Here?).What I did was make sure that I used every letter in the alphabet in my gui before calling writeFontCache(), the problem only shows up on characters that you haven't used before, which I found, was just in my player name, since that was entered in from the user. So I just make a player called abcdefhijklmnopqrstuvwxyz1234567890, then used the .uft generated after that.
#5
03/16/2009 (4:38 pm)
this issue isnt because of the fonts it is because of the text list control.
#6
03/17/2009 (10:02 am)
anyone?
#7
Does it fix itself when you just popDialog/pushDialog or do you have to load a new level?
Maybe post a screenshot?
Also, try doing an echo of the variable that holds the text, maybe that is being modified somehow.
Actually, try checking all of your pos/size variables, just to make sure something isn't changing one of them.
03/17/2009 (11:42 am)
So sometimes when you load the GUI the textlist is cutoff?Does it fix itself when you just popDialog/pushDialog or do you have to load a new level?
Maybe post a screenshot?
Also, try doing an echo of the variable that holds the text, maybe that is being modified somehow.
Actually, try checking all of your pos/size variables, just to make sure something isn't changing one of them.
#8
So the issue is that the extend values do not get updated correctly when you add a new rows. you need to resize them yourself. the weird this is, that this works without the hack on windows, but doesnt work on mac or iphone.
example if i had 32 levels only 24 would appear in the list. this is because the height of the control doesn't resize correctly. So for each list item i have to know the height of it plus any padding. in my case each item is 30pixels high.
//code
levelListCtrl.resize( getWord( levelListCtrl.Position,0 ),
getWord( levelListCtrl.Position,1 ),
getWord( levelListCtrl.Extent,0 ),
%index * 30); // resizing of the length happens here
03/17/2009 (11:55 am)
i have found an interm fix for it . So the issue is that the extend values do not get updated correctly when you add a new rows. you need to resize them yourself. the weird this is, that this works without the hack on windows, but doesnt work on mac or iphone.
example if i had 32 levels only 24 would appear in the list. this is because the height of the control doesn't resize correctly. So for each list item i have to know the height of it plus any padding. in my case each item is 30pixels high.
//code
levelListCtrl.resize( getWord( levelListCtrl.Position,0 ),
getWord( levelListCtrl.Position,1 ),
getWord( levelListCtrl.Extent,0 ),
%index * 30); // resizing of the length happens here
Torque 3D Owner Dave Young
Dave Young Games
The other font problem I am seeing is that I am using a timer based loop in a GUI to write to a ml text field, and it's skipping random letters also, not the same ones either. So, there's some devilry afoot.