docsby gkjohnson
On this page

Properties

isFull: boolean

capacity: number

count: number

Methods

new MVTGlyphAtlasTexture(
	// Maximum number of slots in the atlas.
	slotCount: number = 32,

	// Width and height of each slot in pixels.
	slotSize: number = 64
)
keys(): void
has( key: string ): boolean
get( key: string ): Object | null
getSlotSize( target: Vector2 ): Vector2
getUV( key: string ): Object | null
drawChar(
	key: string,

	// The character to draw.
	char: string,
	styles: {
		// CSS font string (e.g. `'bold 48px sans-serif'`).
		font: string = '',

		// CSS fill color.
		color: string = 'white',

		// CSS stroke color drawn under the fill, or null to skip the stroke.
		strokeStyle: string | null = null,

		// Stroke width in atlas pixels.
		strokeWidth: number = 1
	}
): Object
measureChar( char: string, font: string ): TextMetrics
drawImage(
	key: string,
	image: HTMLImageElement | HTMLCanvasElement | ImageBitmap
): Object
drawPath(
	key: string,
	path2D: Path2D,
	styles: {
		// CSS fill color, or null to skip fill.
		fillStyle: string | null = null,

		// CSS stroke color, or null to skip stroke.
		strokeStyle: string | null = null,

		// Stroke width in pixels.
		lineWidth: number = 1
	}
): Object
drawSVG(
	key: string,
	svgText: string,
	styles: {
		// CSS fill color, or null to skip fill.
		fillStyle: string | null = 'white',

		// CSS stroke color, or null to skip stroke.
		strokeStyle: string | null = null,

		// Visible stroke width in atlas pixels.
		strokeWidth: number = 1,

		// Fraction of the slot size the icon occupies (0–1).
		iconScale: number = 1
	}
): Object
release( key: string ): void
resize(
	// New maximum slot count.
	slotCount: number,

	// New slot size in pixels. Defaults to current size.
	slotSize?: number
): void
clear(): void