new ImageFont(tileInfo)engineDraw.js:1958Create an image font
tileInfoTileInfoTile info of first character in font
// use built in font
const font = engineImageFont;
// draw text
font.drawTextScreen('LittleJS\nHello World!', vec2(200, 50), 16);Image Font Object - Draw text by using tiles in an image
new ImageFont(tileInfo)engineDraw.js:1958Create an image font
tileInfo TileInfoTile info of first character in font
// use built in font
const font = engineImageFont;
// draw text
font.drawTextScreen('LittleJS\nHello World!', vec2(200, 50), 16);tileInfo : TileInfoengineDraw.js:1968Tile info for the font
drawText(text, pos, size, center, color, useWebGL, context)engineDraw.js:1981Draw text in world space using the image font
text string|numberpos Vector2size Vector2|number optional, default 1center boolean optional, default truecenter each line on pos, and the lines of multi-line text around it
color Color optional, default WHITEuseWebGL boolean optional, default glEnablecontext CanvasRenderingContext2D|OffscreenCanvasRenderingContext2D optionaldrawTextScreen(text, pos, size, center, color, useWebGL, context)engineDraw.js:2010Draw text in screen space using the image font
text string|numberpos Vector2size Vector2|numbercenter boolean optional, default truecenter each line on pos, and the lines of multi-line text around it
color Color optional, default WHITEuseWebGL boolean optional, default glEnablecontext CanvasRenderingContext2D|OffscreenCanvasRenderingContext2D optionalgetGlyphPos(index, pos) → Vector2engineDraw.js:2057Get where a glyph sits in the texture: counted in the font's own columns when its tile has them, like a font packed by loadSprite, otherwise along the texture's grid from the font's first tile, the way tile() lays it out
index numberGlyph number, 0 is the space and the characters follow in ASCII order
pos Vector2 optionalWritten into and returned, for a loop that places many