Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TextBuffer

Text buffer. Renders screen-aligned text strings.

example

var textBuffer = new TextBuffer({ position: new Float32Array([ 0, 0, 0 ]), color: new Float32Array([ 1, 0, 0 ]), size: new Float32Array([ 2 ]), text: [ "Hello" ] });

Hierarchy

Index

Constructors

constructor

Properties

alwaysTransparent

alwaysTransparent: boolean = true

dynamic

dynamic: boolean = true

fragmentShader

fragmentShader: string = "SDFFont.frag"

geometry

geometry: BufferGeometry = new BufferGeometry()

group

group: Group = new Group()

hasWireframe

hasWireframe: boolean = false

index

index: Uint32Array | Uint16Array

indexVersion

indexVersion: number = 0

isImpostor

isImpostor: boolean = false

isLine

isLine: boolean = false

isPoint

isPoint: boolean = false

isSurface

isSurface: boolean = false

isText

isText: boolean = true

material

material: ShaderMaterial

parameterTypes

parameterTypes: { backgroundColor: object; backgroundOpacity: object; borderColor: object; borderWidth: object; fixedSize: object; fontFamily: object; fontSize: object; fontStyle: object; fontWeight: object; showBorder: object; xOffset: object; yOffset: object; zOffset: object } & { matrix: {}; background: object; clipCenter: object; clipNear: object; clipRadius: object; depthWrite: object; diffuse: object; diffuseInterior: object; flatShaded: object; interiorColor: object; interiorDarkening: object; metalness: object; opacity: object; opaqueBack: object; roughness: object; side: object; useInteriorColor: object; wireframe: object } = TextBufferParameterTypes

parameters

Optional picking

picking: Picker

pickingGroup

pickingGroup: Group = new Group()

pickingMaterial

pickingMaterial: ShaderMaterial

pickingUniforms

pickingUniforms: Uniforms

positionCount

positionCount: number

text

text: string[]

textAtlas

textAtlas: TextAtlas

texture

texture: CanvasTexture

uniforms

uniforms: Uniforms

vertexShader

vertexShader: string = "SDFFont.vert"

visible

visible: boolean = true

Optional wireframeGeometry

wireframeGeometry: BufferGeometry

wireframeGroup

wireframeGroup: Group = new Group()

Optional wireframeIndex

wireframeIndex: Uint32Array | Uint16Array

wireframeIndexCount

wireframeIndexCount: number = 0

wireframeIndexVersion

wireframeIndexVersion: number = -1

wireframeMaterial

wireframeMaterial: ShaderMaterial

Accessors

attributeSize

  • get attributeSize(): number

defaultParameters

  • get defaultParameters(): { attachment: "bottom-left" | "bottom-center" | "bottom-right" | "middle-left" | "middle-center" | "middle-right" | "top-left" | "top-center" | "top-right"; backgroundColor: string | number; backgroundMargin: number; backgroundOpacity: number; borderColor: string | number; borderWidth: number; fixedSize: false; fontFamily: "sans-serif" | "monospace" | "serif"; fontSize: number; fontStyle: "normal" | "italic"; fontWeight: "normal" | "bold"; forceTransparent: true; showBackground: false; showBorder: false; xOffset: number; yOffset: number; zOffset: number } & { background: boolean; clipCenter: Vector3; clipNear: number; clipRadius: number; depthWrite: boolean; diffuse: number; diffuseInterior: boolean; disablePicking: boolean; flatShaded: boolean; forceTransparent: boolean; interiorColor: number; interiorDarkening: number; matrix: Matrix4; metalness: number; opacity: number; opaqueBack: boolean; roughness: number; side: "double" | "front" | "back"; sortParticles: boolean; useInteriorColor: boolean; wireframe: boolean }
  • Returns { attachment: "bottom-left" | "bottom-center" | "bottom-right" | "middle-left" | "middle-center" | "middle-right" | "top-left" | "top-center" | "top-right"; backgroundColor: string | number; backgroundMargin: number; backgroundOpacity: number; borderColor: string | number; borderWidth: number; fixedSize: false; fontFamily: "sans-serif" | "monospace" | "serif"; fontSize: number; fontStyle: "normal" | "italic"; fontWeight: "normal" | "bold"; forceTransparent: true; showBackground: false; showBorder: false; xOffset: number; yOffset: number; zOffset: number } & { background: boolean; clipCenter: Vector3; clipNear: number; clipRadius: number; depthWrite: boolean; diffuse: number; diffuseInterior: boolean; disablePicking: boolean; flatShaded: boolean; forceTransparent: boolean; interiorColor: number; interiorDarkening: number; matrix: Matrix4; metalness: number; opacity: number; opaqueBack: boolean; roughness: number; side: "double" | "front" | "back"; sortParticles: boolean; useInteriorColor: boolean; wireframe: boolean }

indexSize

  • get indexSize(): number

mapping

  • get mapping(): Float32Array

mappingIndices

  • get mappingIndices(): Uint16Array

mappingIndicesSize

  • get mappingIndicesSize(): number

mappingItemSize

  • get mappingItemSize(): number

mappingSize

  • get mappingSize(): number

matrix

  • get matrix(): Matrix4
  • set matrix(m: Matrix4): void

pickable

  • get pickable(): boolean

size

  • get size(): number

transparent

  • get transparent(): boolean

Methods

_getMesh

  • _getMesh(materialName: BufferMaterials): LineSegments<BufferGeometry, ShaderMaterial> | Points<BufferGeometry, ShaderMaterial> | Mesh<BufferGeometry, ShaderMaterial>

addAttributes

  • addAttributes(attributes: any): void

addUniforms

dispose

  • dispose(): void

getAttributeIndex

  • getAttributeIndex(dataIndex: number): number

getDefines

getFragmentShader

getMesh

  • getMesh(): LineSegments<BufferGeometry, ShaderMaterial> | Points<BufferGeometry, ShaderMaterial> | Mesh<BufferGeometry, ShaderMaterial>
  • Returns LineSegments<BufferGeometry, ShaderMaterial> | Points<BufferGeometry, ShaderMaterial> | Mesh<BufferGeometry, ShaderMaterial>

getParameters

  • getParameters(): { background: boolean; clipCenter: Vector3; clipNear: number; clipRadius: number; depthWrite: boolean; diffuse: number; diffuseInterior: boolean; disablePicking: boolean; flatShaded: boolean; forceTransparent: boolean; interiorColor: number; interiorDarkening: number; matrix: Matrix4; metalness: number; opacity: number; opaqueBack: boolean; roughness: number; side: "double" | "front" | "back"; sortParticles: boolean; useInteriorColor: boolean; wireframe: boolean }
  • Returns { background: boolean; clipCenter: Vector3; clipNear: number; clipRadius: number; depthWrite: boolean; diffuse: number; diffuseInterior: boolean; disablePicking: boolean; flatShaded: boolean; forceTransparent: boolean; interiorColor: number; interiorDarkening: number; matrix: Matrix4; metalness: number; opacity: number; opaqueBack: boolean; roughness: number; side: "double" | "front" | "back"; sortParticles: boolean; useInteriorColor: boolean; wireframe: boolean }

    • background: boolean
    • clipCenter: Vector3
    • clipNear: number
    • clipRadius: number
    • depthWrite: boolean
    • diffuse: number
    • diffuseInterior: boolean
    • disablePicking: boolean
    • flatShaded: boolean
    • forceTransparent: boolean
    • interiorColor: number
    • interiorDarkening: number
    • matrix: Matrix4
    • metalness: number
    • opacity: number
    • opaqueBack: boolean
    • roughness: number
    • side: "double" | "front" | "back"
    • sortParticles: boolean
    • useInteriorColor: boolean
    • wireframe: boolean

getPickingMesh

  • getPickingMesh(): LineSegments<BufferGeometry, ShaderMaterial> | Points<BufferGeometry, ShaderMaterial> | Mesh<BufferGeometry, ShaderMaterial>

getRenderOrder

  • getRenderOrder(): number

getShader

getVertexShader

getWireframeMesh

  • getWireframeMesh(): LineSegments<BufferGeometry, ShaderMaterial>

initIndex

  • initIndex(index: Uint32Array | Uint16Array): void

makeIndex

  • makeIndex(): void

makeMapping

  • makeMapping(): void

makeMaterial

  • makeMaterial(): void

makeTexture

  • makeTexture(): void

makeWireframeGeometry

  • makeWireframeGeometry(): void

makeWireframeIndex

  • makeWireframeIndex(): void

setAttributes

setMatrix

  • setMatrix(m: Matrix4): void

setParameters

setProperties

  • setProperties(data: any): void

setUniforms

  • setUniforms(data: any): void

setVisibility

  • setVisibility(value: boolean): void

toJSON

  • toJSON(): any

updateRenderOrder

  • updateRenderOrder(): void

updateShader

  • updateShader(): void

updateWireframeIndex

  • updateWireframeIndex(): void

Generated using TypeDoc