Options
All
  • Public
  • Public/Protected
  • All
Menu

three.js text rendering engine which can manage and render high-quality, transformable, stylable and properly layout SDF and MSDF text.

Hierarchy

  • TextCanvas

Index

Constructors

constructor

Properties

Readonly maxGlyphCount

maxGlyphCount: number

Maximum amount of glyphs each TextCanvas layer can store.

Readonly minGlyphCount

minGlyphCount: number

Minimum amount of glyphs each TextCanvas layer can store.

Optional Readonly name

name: undefined | string

Accessors

backgroundMaterial

  • get backgroundMaterial(): Material
  • set backgroundMaterial(value: Material): void

fontCatalog

material

  • get material(): Material
  • set material(value: Material): void

textLayoutStyle

textRenderStyle

Methods

addLayer

addText

  • Adds the input text to this TextCanvas in the specified screen position. The current TextRenderStyle and TextLayoutStyle will influence the results of this function.

    Parameters

    • text: string | GlyphData[]

      Input text. Provide an array of GlyphData for better performance.

    • position: Vector3

      Screen position.

    • Optional params: AdditionParameters

      Optional addition parameters.

    Returns boolean

    Result of the addition. If false, some error occurred during execution and the input text couldn't be properly added.

addTextBufferObject

clear

  • clear(): void

createTextBufferObject

getAllLayers

getLayer

getMemoryUsage

measureText

  • Returns the computed bounding box for the input text. The current TextRenderStyle and TextLayoutStyle will influence the results of this function.

    Parameters

    • text: string | GlyphData[]

      Input text. Provide an array of GlyphData for better performance.

    • outputBounds: Box2

      Output text bounding box.

    • Optional params: MeasurementParameters

      Optional measurement parameters.

    Returns boolean

    Result of the measurement. If false, some error occurred during execution and the input text couldn't be properly measured.

pickText

  • pickText(position: Vector2, callback: (pickData: any | undefined) => void): void
  • Executes the pickCallback for all previously stored picking data for text covering the specified screen position.

    Parameters

    • position: Vector2
    • callback: (pickData: any | undefined) => void
        • (pickData: any | undefined): void
        • Parameters

          • pickData: any | undefined

          Returns void

    Returns void

render

  • render(camera: OrthographicCamera, lowerLayerId?: undefined | number, higherLayerId?: undefined | number, target?: THREE.WebGLRenderTarget, clear?: undefined | false | true): void
  • Renders the content of this TextCanvas.

    Parameters

    • camera: OrthographicCamera

      Orthographic camera.

    • Optional lowerLayerId: undefined | number

      Optional Id the first layer to be rendered has to be equal or above

    • Optional higherLayerId: undefined | number

      Optional Id the last layer to be rendered has to be below

    • Optional target: THREE.WebGLRenderTarget

      Optional render target.

    • Optional clear: undefined | false | true

      Optional render target clear operation.

    Returns void

Generated using TypeDoc