Game Development Community

Text alignment

by David Taylor · in Torque Game Builder · 08/02/2006 (6:37 pm) · 1 replies

A) I have a guitextctrl that I'd like to centre the text for so that I can use it as a heading. Is there any way to do this?

I have made the guitextctrl, and set the HorizSizing value to 'center'. But the text still comes out on the left.

B) Also, is there any way to make text fall down to the next 'line' if the text is too long? As in, paragraphs form instead of single lines going off into the wide blue yonder...?

#1
08/02/2006 (7:29 pm)
I use a Profile to accomlish centering in a GuiTextCtrl.

in my profiles.cs:

if(!isObject(TitleTextProfile)) new GuiControlProfile (TitleTextProfile)
{
// set the type face
fontType = "Comic Sans MS";

// set the font size
fontSize = 60;

// set the font color
fontColor = "63 95 141";

// enter the text
justify = "center";
};

and in the Gui Editor set the profile to TitleTextProfile

There are some other postings about using profiles (and the TDN examples).

Also for the Multi-line text box use GuiMLTextBox it also supports a minimal markup language..