Skip to content

textmode.js / Textmodifier / createTexture

Method: createTexture()

ts
createTexture(source): TextmodeTexture;

Create a dynamic texture from an external canvas or video element.

Use this to sample canvases or videos rendered by libraries such as three.js, p5.js, Babylon.js, or hydra-synth.

The texture automatically updates each frame to capture the latest content from the source.

Parameters

ParameterTypeDescription
sourceHTMLCanvasElement | HTMLVideoElementCanvas or video element to capture.

Returns

TextmodeTexture

A TextmodeTexture that can be drawn with image.

Example