textmode.js / converters / TextmodeFeatureConverter
Class: abstract
TextmodeFeatureConverter
Abstract base class for all feature-based textmode converters like 'brightness'
.
Extends
Extended by
Constructors
Constructor
protected new TextmodeFeatureConverter(
renderer,
fontManager,
grid,
options): TextmodeFeatureConverter;
Parameters
renderer
GLRenderer
fontManager
grid
options
any
= {}
Returns
TextmodeFeatureConverter
Overrides
TextmodeConverter.constructor
Properties
_characterFramebuffer
protected _characterFramebuffer: Framebuffer;
Inherited from
TextmodeConverter
._characterFramebuffer
_options
protected _options: any;
Inherited from
_primaryColorFramebuffer
protected _primaryColorFramebuffer: Framebuffer;
Inherited from
TextmodeConverter
._primaryColorFramebuffer
_rotationFramebuffer
protected _rotationFramebuffer: Framebuffer;
Inherited from
TextmodeConverter
._rotationFramebuffer
_secondaryColorFramebuffer
protected _secondaryColorFramebuffer: Framebuffer;
Inherited from
TextmodeConverter
._secondaryColorFramebuffer
_transformFramebuffer
protected _transformFramebuffer: Framebuffer;
Inherited from
TextmodeConverter
._transformFramebuffer
fontManager
protected fontManager: TextmodeFont;
Inherited from
grid
protected grid: TextmodeGrid;
Inherited from
palette
protected palette: ColorPalette;
renderer
protected renderer: GLRenderer;
Inherited from
Accessors
characterFramebuffer
Get Signature
get characterFramebuffer(): Framebuffer;
Returns the framebuffer containing character data.
Returns
Framebuffer
Inherited from
TextmodeConverter
.characterFramebuffer
options
Get Signature
get options(): any;
Returns the renderer used by this converter.
Returns
any
Inherited from
primaryColorFramebuffer
Get Signature
get primaryColorFramebuffer(): Framebuffer;
Returns the framebuffer containing primary color data.
Returns
Framebuffer
Inherited from
TextmodeConverter
.primaryColorFramebuffer
rotationFramebuffer
Get Signature
get rotationFramebuffer(): Framebuffer;
Returns the framebuffer containing rotation data.
Returns
Framebuffer
Inherited from
TextmodeConverter
.rotationFramebuffer
secondaryColorFramebuffer
Get Signature
get secondaryColorFramebuffer(): Framebuffer;
Returns the framebuffer containing secondary color data.
Returns
Framebuffer
Inherited from
TextmodeConverter
.secondaryColorFramebuffer
transformFramebuffer
Get Signature
get transformFramebuffer(): Framebuffer;
Returns the framebuffer containing transformation data.
Returns
Framebuffer
Inherited from
TextmodeConverter
.transformFramebuffer
Methods
cellColor()
cellColor(
r,
g,
b,
a): void;
Sets the cell color for all cells affected by the converter. This is only used when cellColorMode
is set to 'fixed'
.
Parameters
r
number
Red component (0-255).
g
number
= r
Green component (0-255).
b
number
= r
Blue component (0-255).
a
number
= 255
Alpha component (0-255).
Returns
void
cellColorMode()
cellColorMode(mode): void;
Sets the cell color mode.
'sampled'
: Uses sampled colors from the source texture.'fixed'
: Uses a fixed color set via cellColor.
Parameters
mode
The color mode to use for background cells.
"sampled"
| "fixed"
Returns
void
characterColor()
characterColor(
r,
g,
b,
a): void;
Sets the color of the characters affected by the converter. This is only used when characterColorMode
is set to 'fixed'
.
Parameters
r
number
Red component (0-255).
g
number
= r
Green component (0-255).
b
number
= r
Blue component (0-255).
a
number
= 255
Alpha component (0-255).
Returns
void
characterColorMode()
characterColorMode(mode): void;
Sets the character color mode.
'sampled'
: Uses sampled colors from the source texture.'fixed'
: Uses a fixed color set bycharacterColor()
.
Parameters
mode
The color mode to use for characters.
"sampled"
| "fixed"
Returns
void
characters()
characters(characters): void;
Sets the characters used for mapping.
Parameters
characters
string
The characters to use for mapping, usually ordered from darkest to brightest.
Returns
void
disable()
disable(): void;
Disables the converter.
Returns
void
Inherited from
enable()
enable(): void;
Enables the converter.
Returns
void
Inherited from
enabled()
enabled(enabled): void;
Enables or disables the converter.
Parameters
enabled
boolean
Whether to enable or disable the converter.
Returns
void
Inherited from
flipHorizontally()
flipHorizontally(flip): void;
Flips the characters horizontally.
Parameters
flip
If true
, characters are flipped horizontally. If false
, no flip is applied.
number
| boolean
Returns
void
flipVertically()
flipVertically(flip): void;
Flips the characters vertically.
Parameters
flip
If true
, characters are flipped vertically. If false
, no flip is applied.
number
| boolean
Returns
void
invert()
invert(invert): void;
Swaps the character and cell color.
Parameters
invert
If true
, the character color becomes the cell color and vice versa.
number
| boolean
Returns
void
rotation()
rotation(angle): void;
Sets the rotation angle for the characters.
Parameters
angle
number
The rotation angle in degrees.
Returns
void