Renderer · function

textWidthPx

Width of a string in pixels at a given cell size, without laying it out.

Explained in Hello world.

function textWidthPx(text: string, cellSize: number): number
import { textWidthPx } from '@driftengine/core';

Parameters

ParameterTypeDescription
textstring
cellSizenumber