class · blotter.ts
Mapping
The packed atlas layout: which rectangle of the shared texture each text occupies. Built by Blotter; exported for custom pipelines.
import { Mapping } from "blotter.ts"; Internal plumbing, exported because a few advanced uses want it. A Blotter makes a new mapping on every build; you can read the one it holds through boundsForText on the instance instead.
Members #
constructor constructor
new Mapping (
texts: Text[] , textBounds: TextBoundsMap , width: number , height: number
)
texts property
readonly mapping. texts : Text[]
ratio get / set
mapping. ratio : number
width get
readonly mapping. width : number
height get
readonly mapping. height : number
boundsForText method
mapping. boundsForText (
text: Text
): TextBounds | undefined
The rectangle a text occupies in the atlas, or undefined.
toCanvas method
mapping. toCanvas (
): HTMLCanvasElement
Draws every text into a single canvas, Y-flipped for WebGL upload. This is the atlas the shader samples.