UNPKG

starling-framework

Version:

A fast, productive library for 2D cross-platform development.

33 lines 1.38 kB
import TextOptions from "./TextOptions"; import TextFormat from "./TextFormat"; import MeshStyle from "../styles/MeshStyle"; import MeshBatch from "../display/MeshBatch"; declare namespace starling.text { /** * A text compositor arranges letters for Starling's TextField. */ export interface ITextCompositor { /** * Draws the given text into a MeshBatch, using the supplied format and options. */ fillMeshBatch(meshBatch: MeshBatch, width: number, height: number, text: string, format: TextFormat, options?: TextOptions): void; /** * Clears the MeshBatch (filled by the same class) and disposes any resources that * * are no longer needed. */ clearMeshBatch(meshBatch: MeshBatch): void; /** * Creates and/or sets up the default MeshStyle to be used for rendering. * * If <code>previousStyle</code> has the correct type, it is configured as needed and * * then returned; otherwise, a new style is created, configured and returned. * * The method may return <code>null</code> if there are no special style requirements. */ getDefaultMeshStyle(previousStyle: MeshStyle, format: TextFormat, options: TextOptions): MeshStyle; /** * Frees all resources allocated by the compositor. */ dispose(): void; } } type ITextCompositor = starling.text.ITextCompositor; export default ITextCompositor;