NGL@1.0.0-beta.7 Home Manual Reference Source Gallery
import TextBuffer from 'ngl/src/buffer/text-buffer.js'
public class | source

TextBuffer

Extends:

BufferMappedBufferMappedQuadBuffer → 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" ]
} );

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public
public
public
public
public
public
public
public
public get
public get
public get
public
public

sdf

public
public
public
public
public
public get
public set
public get
public
public
public

Method Summary

Public Methods
public
public
public
public
public
public

Inherited Summary

From class Buffer
public get
public get
public get abstract
public get
public set
public get
public get
public get
public get
public get abstract
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
public
private
public
public
public

Free buffer resources

public
public
public
public
public
public
public
public
public
public
public
public
public
public

Sets buffer attributes

public
public

Set buffer parameters

public
public
public

Set buffer visibility

public
public
public
private
From class MappedBuffer
public get
public get
public get abstract
public get abstract
public get abstract
public get abstract
public get abstract
public get abstract
public
public
public
public
public
public
From class MappedQuadBuffer
public get
public get
public get
public get
public get
public get

Public Constructors

public constructor(data: Object, params: TextBufferParameters) source

Override:

MappedBuffer#constructor

Params:

NameTypeAttributeDescription
data Object

attribute object

data.position Float32Array

positions

data.color Float32Array

colors

data.size Float32Array

sizes

data.text String[]

text strings

params TextBufferParameters

parameters object

Public Members

public attachment source

public backgroundColor source

public backgroundMargin source

public backgroundOpacity source

public borderColor source

public borderWidth source

public fontFamily source

public fontSize source

public fontStyle source

public fontWeight source

public get fragmentShader source

Override:

Buffer#fragmentShader

public get isText source

public get parameters source

Override:

Buffer#parameters

public positionCount source

public sdf source

public showBackground source

public showBorder source

public text source

public textAtlas source

public texture source

public get vertexShader source

Override:

Buffer#vertexShader

public set wireframe source

Override:

Buffer#wireframe

public get wireframe source

Override:

Buffer#wireframe

public xOffset source

public yOffset source

public zOffset source

Public Methods

public getDefines() source

Override:

Buffer#getDefines

public makeMapping() source

Override:

MappedBuffer#makeMapping

public makeMaterial() source

Override:

Buffer#makeMaterial

public makeTexture() source

public setAttributes() source

Sets buffer attributes

Override:

MappedBuffer#setAttributes

public setUniforms() source

Override:

Buffer#setUniforms