11#include <aegis/system.hpp>
14class TextSystem :
public ae::System,
public ae::Singleton<TextSystem>
42 void drawText(
const std::string& text,
44 uint16_t* videoBuffer,
70 void appearText(std::unique_ptr<Text>& appearingText,
71 const std::string& text,
73 uint16_t* videoBuffer,
82 bool hyphenate =
false);
125 uint16_t* videoBuffer,
141 void clearArea(uint16_t* videoBuffer,
int x,
int y,
int width,
int height);
172 std::unique_ptr<Text>
createText(
const std::string& text,
174 uint16_t* videoBuffer,
199 void drawPixel(uint16_t* videoBuffer,
int x,
int y,
int paletteValue);
211 void underlineGap(
int startX,
int y,
int width, uint16_t* videoBuffer,
int color);
char getNextChar(Text *text)
Get the next character from a given Text object.
bool appearTextDone(Text *appearingText)
Check if the text being rendered with appearText has finished appearing.
void clearArea(uint16_t *videoBuffer, int x, int y, int width, int height)
Clear a rectangular area of the text video buffer.
void underlineGap(int startX, int y, int width, uint16_t *videoBuffer, int color)
Underline a specificed area.
void drawText(const std::string &text, Font *font, uint16_t *videoBuffer, int x, int y, int color, int letterSpacing, int lineSpacing, int spaceWidth, int xBoundary)
Draw text to the screen.
void update(ae::q20_12_t) override
void drawPixel(uint16_t *videoBuffer, int x, int y, int paletteValue)
Draw a single pixel to the video buffer.
void appearTextNextPage(Text *appearingText)
Clear the text area and continue the paused text from the top of it.
void appearText(std::unique_ptr< Text > &appearingText, const std::string &text, Font *font, uint16_t *videoBuffer, int x, int y, int color, int letterSpacing, int lineSpacing, int spaceWidth, int maxX=256, int maxY=0, bool hyphenate=false)
Create a Text object and renders each character with a delay to simulate typing effect.
std::unique_ptr< Text > createText(const std::string &text, Font *font, uint16_t *videoBuffer, int startX, int startY, int color, int letterSpacing, int lineSpacing, int spaceWidth, int maxX=256, int maxY=0)
Create a Text object and initialize its properties.
void testPalette(uint16_t *videoBuffer)
Test function to draw the currently loaded palette to the screen.
void drawGlyph(const Glyph &glyph, Font *font, uint16_t *videoBuffer, int x, int y, int color, bool bold, bool italic, bool underline)
Draw a single glyph to the screen.
void appearTextSkip(Text *appearingText)
If a text is currently being rendered with appearText, this function will immediately render the rest...
void testBitmap(Font *font, uint16_t *videoBuffer)
Test function to draw the font bitmap to the screen.
bool appearTextPaused(Text *appearingText)
Check if the text being rendered with appearText is waiting for the next page.
int SLANT_FACTOR
128 = 1 pixel shift every 2 rows, 64 = 1 pixel shift every 4 rows
void drawNextFromText(Text *text)
Draw the next character from the text struct to the screen.
friend class TextComponent
Holds routerIDs used for systems.
Stores data for a single glyph (character) in a font.
A struct that represents a block of text being rendered on the screen.