static Font FromFile(string fontFile)

string fontFile A file address for the font! For example: ‘C:/Windows/Fonts/segoeui.ttf’
RETURNS: Font A font from the given file, or null if the file failed to load properly!

Loads a font and creates a font asset from it.


Drawing text with and without a TextStyle

Basic text We can use a TextStyle object to control how text gets displayed!

TextStyle style;

In initialization, we can create the style from a font, a size, a material, and a base color.

style = Text.MakeStyle(
    2 *,
    Color.HSV(0.05f, 0.7f, 0.8f));

Then it’s pretty trivial to just draw some text on the screen! Just call Text.Add on update. If you don’t have a TextStyle available, calling it without one will just fall back on the default style.

// Text with an explicit text style
    Matrix.TRS(new Vec3(0.1f, 0, 0), Quat.LookDir(0, 0, 1)),
// Text using the default text style
    Matrix.TRS(new Vec3(-0.1f, 0, 0), Quat.LookDir(0, 0, 1)));