textmode.js / media / TextmodeTexture
Class: TextmodeTexture
Dynamic texture source for external canvas or video content.
Create one with Textmodifier.createTexture and draw it with Textmodifier.image. The texture refreshes each frame so it can mirror renderers such as three.js, p5.js, Babylon.js, or hydra-synth.
Extends
Extended by
Accessors
| Accessor | Description |
|---|---|
| height | Ideal draw height in grid cells. |
| originalHeight | Original source height in pixels. |
| originalWidth | Original source width in pixels. |
| source | Source element this texture captures. |
| texture | WebGL texture backing this source. |
| width | Ideal draw width in grid cells. |
Methods
| Method | Description |
|---|---|
| background | Set the background color used for transparent pixels. |
| brightnessRange | Capture only source pixels whose brightness is inside the inclusive byte range. |
| cellColor | Set the cell color used when cellColorMode is 'fixed'. |
| cellColorMode | Set whether cell color is sampled from the source or fixed. |
| characters | Set the characters used for brightness mapping. |
| charColor | Set the character color used when charColorMode is 'fixed'. |
| charColorMode | Set whether character color is sampled from the source or fixed. |
| charRotation | Rotate generated characters. |
| clearConversions | Clear this source's conversion stack and return to single-mode conversion. |
| conversionMode | Select the conversion mode for this source. |
| conversions | Set an ordered conversion stack for this source. |
| dispose | Dispose of the resource and free associated WebGL textures. |
| flipX | Flip the source horizontally. |
| flipY | Flip the source vertically. |
| invert | Enable or disable source color inversion. |