ridder
Version:
A straightforward game engine for simple data-driven games in JavaScript
16 lines (15 loc) • 535 B
TypeScript
/**
* Load a font into the cache.
*
* Use `setFont` in the `setup` or `render` functions to use the font in the upcoming text rendering.
*
* @param id - The ID for the font in the cache.
* @param url - The url to the `.ttf` or `.otf` file.
* @param family - The name of the font family.
* @param size - The base size in pixels.
*/
export declare function loadFont(id: number, url: string, family: string, size: number): Promise<void>;
/**
* Get a font from the cache.
*/
export declare function getFont(id: number): string;