How to use font helper?
by Raja John · in Torque Game Builder · 12/10/2008 (4:12 am) · 3 replies
I wish to apply bitmap for t2d text object in my game, TGB users suggest "FONT HELPER" for it
But it is not work for me, where can i put the function and call it for t2d text object?
Thanks
But it is not work for me, where can i put the function and call it for t2d text object?
Thanks
About the author
#2
i already added this.. but i dont know where to put the below function
function loadCustomFont( %name, %size, %weight){
%pngdir = "pngs/";
%fontdir = "common/ui/cache/";
%fileName = %fontdir @ %pngdir @ %name SPC %size @ ".png";
importCachedFont( %name, %size, %fileName, %weight, 0);
}
and where to call this..
loadCustomFont( "Seabird SF", 80, 0 );
can i call it for a t2dTextObject (sampleText.loadCustomFont( "Seabird SF", 80, 0 );)?...
Thanks again.
12/11/2008 (4:55 am)
Thanks.....i already added this.. but i dont know where to put the below function
function loadCustomFont( %name, %size, %weight){
%pngdir = "pngs/";
%fontdir = "common/ui/cache/";
%fileName = %fontdir @ %pngdir @ %name SPC %size @ ".png";
importCachedFont( %name, %size, %fileName, %weight, 0);
}
and where to call this..
loadCustomFont( "Seabird SF", 80, 0 );
can i call it for a t2dTextObject (sampleText.loadCustomFont( "Seabird SF", 80, 0 );)?...
Thanks again.
#3
12/11/2008 (7:04 pm)
Hi I made the font helper. You should load your fonts at some point before you start using them in the game or before the level starts. There is no need to call it for textobjects like in the above example. Many textobjects can and should all share the same font(s) as they only reference them.
Torque Owner Brian Wilson
I updated the TDN with installation instructions.