UI.Text

static void Text(string text, TextAlign textAlign)

Displays a large chunk of text on the current layout. This can include new lines and spaces, and will properly wrap once it fills the entire layout! Text uses the UI’s current font settings, which can be changed with UI.Push/PopTextStyle.

   
string text The text you wish to display, there’s no additional parsing done to this text, so put it in as you want to see it!
TextAlign textAlign Where should the text position itself within its bounds? TextAlign.TopLeft is how most English text is aligned.
static void Text(string text, TextAlign textAlign, TextFit fit, Vec2 size)

Displays a large chunk of text on the current layout. This can include new lines and spaces, and will properly wrap once it fills the entire layout! Text uses the UI’s current font settings, which can be changed with UI.Push/PopTextStyle.

   
string text The text you wish to display, there’s no additional parsing done to this text, so put it in as you want to see it!
TextAlign textAlign Where should the text position itself within its bounds? TextAlign.TopLeft is how most English text is aligned.
TextFit fit Describe how the text should behave when one of its size dimensions conflicts with the provided ‘size’ parameter. UI.Text uses TextFit.Wrap by default.
Vec2 size The layout size for this element in Hierarchy space. If an axis is left as zero, it will be auto-calculated. For X this is the remaining width of the current layout, and for Y this is UI.LineHeight.

Examples

Separating UI Visually

A window with text and a separator

A separator is a simple visual element that fills the window horizontally. It’s nothing complicated, but can help create visual association between groups of UI elements.

Pose windowPoseSeparator = new Pose(.6f, 0, 0, Quat.Identity);
void ShowWindowSeparator()
{
	UI.WindowBegin("Window Separator", ref windowPoseSeparator, UIWin.Body);

	UI.Label("Content Header");
	UI.HSeparator();
	UI.Text("A separator can go a long way towards making your content "
	      + "easier to look at!", TextAlign.TopCenter);

	UI.WindowEnd();
}




Found an issue with these docs, or have some additional questions? Create an Issue on Github!