new FontLoader()
Load fonts and lets you know when they're all available. An instance of FontLoader is available as Splat.Game#fonts.
- Source:
Methods
allLoaded() → {boolean}
Test if all font fonts have loaded.
- Source:
Returns:
- Type
- boolean
load(fontFamilies)
Load a font.
Parameters:
Name | Type | Description |
---|---|---|
fontFamilies |
object | A key-value object that maps css font-family names to another object that holds paths to the various font files in different formats. |
- Source:
Example
game.fonts.load({
"pixelade": {
"embedded-opentype": "pixelade/pixelade-webfont.eot",
"woff": "pixelade/pixelade-webfont.woff",
"truetype": "pixelade/pixelade-webfont.ttf",
"svg": "pixelade/pixelade-webfont.svg#pixeladeregular"
}
});