drawText method
Draws text at the specified position with styling options.
This is the primary method for text rendering. Text extends horizontally from the given position and will be clipped at buffer boundaries.
Example:
// Simple text
buffer.drawText('Hello', 0, 0, Color.white);
// Styled text with background
buffer.drawText('Error!', 10, 5, Color.red,
bg: Color.yellow, attributes: TextAttribute.bold);
Implementation
void drawText(
String text,
int x,
int y,
Color fg, {
Color? bg,
int attributes = 0,
}) {
_checkValid();
_bindings.bufferDrawText(_ptr, text, x, y, fg, bg, attributes);
}