TinyGPU
Loading...
Searching...
No Matches
Public Member Functions | List of all members
LinePrinter< RGB_T > Class Template Reference

Helper for printing wrapped lines of text onto a TinyGPU target. More...

#include <LinePrinter.h>

Public Member Functions

 LinePrinter ()=default
 
 LinePrinter (IFont< RGB_T > &font, ISurface< RGB_T > &target)
 Creates a line printer for the given font and target.
 
void setColor (RGB_T color)
 
void setBackgroundColor (RGB_T color)
 
void setFont (IFont< RGB_T > &font)
 Sets the Font implementation.
 
void setTarget (ISurface< RGB_T > &target)
 Sets the TinyGPU target.
 
void setTopBorder (size_t border)
 Sets the top border in pixels.
 
void setLeftBorder (size_t border)
 Sets the left border in pixels.
 
void setRightBorder (size_t border)
 Sets the right border in pixels.
 
void setButtomBorder (size_t border)
 Sets the bottom border in pixels.
 
void setBorders (size_t border)
 Sets all borders to the same value.
 
void setActualLine (size_t line)
 Sets the current line index.
 
void setScale (uint8_t scale)
 Sets the text scale factor.
 
void setSpacing (uint8_t spacing)
 Sets the spacing between glyphs.
 
size_t print (const char *text)
 Prints text with word wrapping.
 
size_t println (const char *text)
 Prints text and advances to the next line.
 
size_t println ()
 Advances to the next line.
 

Detailed Description

template<typename RGB_T = RGB565>
class tinygpu::LinePrinter< RGB_T >

Helper for printing wrapped lines of text onto a TinyGPU target.

The printer tracks a cursor position, applies configurable borders, and wraps words to the next line when text would exceed the drawable width.

Constructor & Destructor Documentation

◆ LinePrinter() [1/2]

LinePrinter ( )
default

◆ LinePrinter() [2/2]

LinePrinter ( IFont< RGB_T > &  font,
ISurface< RGB_T > &  target 
)
inline

Creates a line printer for the given font and target.

Member Function Documentation

◆ print()

size_t print ( const char *  text)
inline

Prints text with word wrapping.

◆ println() [1/2]

size_t println ( )
inline

Advances to the next line.

◆ println() [2/2]

size_t println ( const char *  text)
inline

Prints text and advances to the next line.

◆ setActualLine()

void setActualLine ( size_t  line)
inline

Sets the current line index.

◆ setBackgroundColor()

void setBackgroundColor ( RGB_T  color)
inline

◆ setBorders()

void setBorders ( size_t  border)
inline

Sets all borders to the same value.

◆ setButtomBorder()

void setButtomBorder ( size_t  border)
inline

Sets the bottom border in pixels.

◆ setColor()

void setColor ( RGB_T  color)
inline

◆ setFont()

void setFont ( IFont< RGB_T > &  font)
inline

Sets the Font implementation.

◆ setLeftBorder()

void setLeftBorder ( size_t  border)
inline

Sets the left border in pixels.

◆ setRightBorder()

void setRightBorder ( size_t  border)
inline

Sets the right border in pixels.

◆ setScale()

void setScale ( uint8_t  scale)
inline

Sets the text scale factor.

◆ setSpacing()

void setSpacing ( uint8_t  spacing)
inline

Sets the spacing between glyphs.

◆ setTarget()

void setTarget ( ISurface< RGB_T > &  target)
inline

Sets the TinyGPU target.

◆ setTopBorder()

void setTopBorder ( size_t  border)
inline

Sets the top border in pixels.


The documentation for this class was generated from the following file: