Documentation Index
Fetch the complete documentation index at: https://mintlify.com/anomalyco/opentui/llms.txt
Use this file to discover all available pages before exploring further.
OptimizedBuffer
TheOptimizedBuffer class (also known as FrameBuffer) provides low-level access to terminal rendering. It manages a grid of cells, each containing a character, foreground color, background color, and text attributes.
Creating Buffers
Create a new framebuffer
Width in terminal cells
Height in terminal cells
Character width calculation method
Whether to respect alpha channel when compositing. Default:
falseOptional identifier for debugging
Properties
Buffer width in cells
Buffer height in cells
Character width calculation method used by this buffer
Whether alpha blending is enabled
Native pointer to the underlying buffer (for advanced use)
Direct access to raw buffer data
Drawing Methods
Clear the entire buffer with a background color
Background color. Default:
RGBA.fromValues(0, 0, 0, 1)Set a single cell with no alpha blending
X coordinate (column)
Y coordinate (row)
Character to display (first codepoint used)
Foreground color
Background color
Text attributes (bold, italic, underline, etc.). Default:
0Set a single cell with alpha blendingSame parameters as
setCell, but blends colors using alpha channel.Draw text at a position with optional selection
Text to draw
Starting X coordinate
Starting Y coordinate
Foreground color
Background color
Text attributes. Default:
0Optional selection range to highlight
Fill a rectangular area with a background color
Draw a bordered box with optional title
Border style preset
Which sides to draw:
true for all sides, or array like ["top", "left"]Title text alignment. Default:
"left"Draw a grid with custom column/row offsets
Compositing
Composite another framebuffer onto this one
Destination X coordinate
Destination Y coordinate
Source buffer to composite
Source region X offset
Source region Y offset
Source region width
Source region height
Draw a TextBufferView
Draw an EditorView
Image Rendering
Draw pixel data with supersampling
Draw grayscale intensity data
Draw grayscale data with supersampling for smoother rendering
Clipping and Opacity
Push a clipping rectangle onto the stack
Pop the top clipping rectangle from the stack
Remove all clipping rectangles
Push an opacity value onto the stack (multiplies with existing opacity)
Opacity value between 0.0 and 1.0
Pop the top opacity value from the stack
Get the current effective opacity
Clear the opacity stack
Utilities
Resize the buffer (clears content)
Enable or disable alpha blending
Get the buffer’s native identifier
Get the resolved character data as UTF-8 bytes
Whether to add newlines between rows. Default:
falseExtract buffer content as styled text spansReturns an array of lines, each containing spans with text, colors, and attributes.
Destroy the buffer and free native resources