textmode.js / TextmodeOptions
Type Alias: TextmodeOptions
type TextmodeOptions = object;Options when creating a Textmodifier instance via textmode.create.
Properties
canvas?
optional canvas?: HTMLCanvasElement;Existing HTMLCanvasElement to use instead of letting textmode.js create a canvas.
fontSize?
optional fontSize?: number;The font size to use for text rendering. Defaults to 16.
fontSource?
optional fontSource?: string;URL or path to a custom font file (.otf, .ttf, or .woff).
frameRate?
optional frameRate?: number;Maximum frames per second for auto rendering. Defaults to 60.
gl?
optional gl?: WebGL2RenderingContext;Use an external WebGL2 context instead of creating a new one. Useful for integrating with three.js, Babylon.js, hydra-synth, or other WebGL libraries that share the same canvas.
height?
optional height?: number;The height of the canvas when creating a new canvas. Defaults to 600.
loadingScreen?
optional loadingScreen?: LoadingScreenOptions;Configure the built-in loading screen experience.
pixelDensity?
optional pixelDensity?: number;Pixel density multiplier for HiDPI/Retina displays. Defaults to 1.
For internally-created canvases, the backing store size is set to width * pixelDensity × height * pixelDensity while the CSS display size stays at width × height.
Has no effect when using an externally-supplied gl or canvas.
plugins?
optional plugins?: TextmodePlugin[];List of plugins to install when the Textmodifier instance is created.
seed?
optional seed?: string | number;Seed used by the instance-scoped random generator.
Set this when a sketch should produce the same random sequence each time it runs.
width?
optional width?: number;The width of the canvas when creating a new canvas. Defaults to 800.