Text::useFont()
Chooses the font all text is written in, and how big it is.
Call it before the first stage is created. The font is loaded while the window starts up, so choosing one later is not reliable.
public static void main(String[] args) {
Text.useFont("assets/Retro Gaming.ttf", 11);
new MyStage();
}
Syntax
Java
.useFont(path, size)
.useFont(path)
Parameters
| Name | Data Type | Description |
|---|---|---|
| path | String | the path to a .ttf or .otf file |
| size | int | the size to write in |
Return
void