bufferDrawText method
void
bufferDrawText()
Draws UTF-8 text at (x,y) into buffer with fg/bg colors and
packed attributes. A null bg is passed as a null pointer (transparent).
Throws FFIException on failure.
Implementation
void bufferDrawText(
Pointer<OptimizedBufferHandle> buffer,
String text,
int x,
int y,
Color fg,
Color? bg,
int attributes,
) {
_guardAlloc('Failed to draw text', (alloc) {
final (textPtr, textLen) = _utf8(alloc, text);
final fgPtr = fg.toNative(alloc);
final bgPtr = bg?.toNative(alloc) ?? nullptr;
_generated.bufferDrawText(
buffer.cast(),
textPtr,
textLen,
x,
y,
fgPtr,
bgPtr,
attributes,
);
});
}