Difference between revisions of "Legacy:GetSystemFont"
From Spherical
(Created GetSystemFont page) |
(added navbox) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | + | Returns A Sphere [[API:Font|font]] object that is the system font.rfn found in the system/ folder of the Sphere directory. | |
− | |||
− | Returns A Sphere [[API: | ||
==Usage== | ==Usage== | ||
− | {{Usage|returns= | + | {{Usage|returns=[[API:Font|Font]]|func=GetSystemFont}} |
==Notes== | ==Notes== | ||
− | + | * It can be changed by replacing the font.rfn file in the system/ folder in the Sphere directory. Keep in mind that someone else may have left their system font file untouched or replaced it with a different one; if this is the case consider [[API:LoadFont|loading a font local to your project]] instead. | |
− | It can be changed by replacing the font.rfn file in the system/ folder in the Sphere directory. | + | * It's also useful in case you want to quickly throw up some debug numbers. |
− | |||
− | It's also useful in case you want to quickly throw up some debug numbers. | ||
==Examples== | ==Examples== | ||
Line 32: | Line 28: | ||
==See also== | ==See also== | ||
− | |||
* [[API:IsKeyPressed|IsKeyPressed]]() | * [[API:IsKeyPressed|IsKeyPressed]]() | ||
* [[API:FlipScreen|FlipScreen]]() | * [[API:FlipScreen|FlipScreen]]() | ||
* [[API:font/drawText|font.drawText]](x, y, text) | * [[API:font/drawText|font.drawText]](x, y, text) | ||
+ | |||
+ | {{API:Font/navbox}} |
Latest revision as of 21:46, 24 June 2013
Returns A Sphere font object that is the system font.rfn found in the system/ folder of the Sphere directory.
Contents
Usage
Font GetSystemFont();
Notes
- It can be changed by replacing the font.rfn file in the system/ folder in the Sphere directory. Keep in mind that someone else may have left their system font file untouched or replaced it with a different one; if this is the case consider loading a font local to your project instead.
- It's also useful in case you want to quickly throw up some debug numbers.
Examples
Drawing some text to the screen with Sphere's font.
var font = GetSystemFont();
while (!IsKeyPressed(KEY_ESCAPE) {
for (var i = 0; i < 10; ++i) {
font.drawText(0, i*16, The number is: " + i);
}
FlipScreen();
}
See also
- IsKeyPressed()
- FlipScreen()
- font.drawText(x, y, text)