What it does
LoadFont writes to a Font object: it loads rather than reads. It takes szFontFile (a string), and answers an integer. That is the first of 2 forms.
Syntax
1
LoadFont(szFontFile string) → integer2
LoadFont(iFontID integer, szFontFile string)Parameters
| Name | Type | In forms |
|---|---|---|
| szFontFile | string | all |
| iFontID | integer | 2 |
What each form returns
| 1 | font = LoadFont("assets/font.ttf") | integer |
| 2 | LoadFont(1, "assets/font.ttf") | nothing |
Example · generated
Form 1, the command hands back the id
font = LoadFont("assets/font.ttf")DO Sync()LOOPForm 2, you choose the id yourself
LoadFont(1, "assets/font.ttf")DO Sync()LOOPLoadFont is called and its answer is printed every frame. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.