Skip to content

textmode.js / Textmodifier / shader

Method: shader()

ts
shader(shader): void;

Set a custom shader for subsequent drawing operations.

The shader persists until explicitly reset via resetShader or by calling shader(null). This behavior matches p5.js, allowing multiple draw calls with the same shader.

Parameters

ParameterTypeDescription
shaderTextmodeShader | nullCustom shader to use, or null to reset to the default shader.

Returns

void

Example