Text Manipulation
by Phillip O'Shea · in Torque Game Builder · 08/02/2007 (9:46 pm) · 2 replies
Is there any possible way to stretch the width of a font, or put spaces in between letter for the GUI text control object?
Failing that, can I use fonts that I have imported into the font cache with GUI text boxes?
Thank you
Failing that, can I use fonts that I have imported into the font cache with GUI text boxes?
Thank you
About the author
Head of Violent Tulip, a small independent software development company working in Wollongong, Australia. Go to http://www.violent-tulip.com/ to see our latest offerings.
#2
As for stretching the actual letters, you'd need to modify the engine for that. And having tried it, it screws up the aliasing. Probably simpler to just use a wide font.
08/14/2007 (2:10 pm)
If you just want spacing, you could add a function to GuiTextCtrl:function GuiTextCtrl::setTextSpaced(%this, %text, %spacing)
{
%length = strlen(%text);
if(%length == 0)
%this.setText("");
if(%spacing <= 0)
%this.setText(%text);
%spacer = " ";
for(%i=1; %i<%spacing; %i++)
%spacer = %spacer @ " ";
%result = getSubStr(%text, 0, 1);
for(%i=1; %i<%length; %i++)
%result = %result @ %spacing @ getSubStr(%text, %i, 1);
%this.setText(%result);
}As for stretching the actual letters, you'd need to modify the engine for that. And having tried it, it screws up the aliasing. Probably simpler to just use a wide font.
Associate James Ford
Sickhead Games