|
persona-3-dual
A DS demake of Persona 3
|
#include <TextComponent.hpp>


Public Member Functions | |
| void | init () override |
| void | destroy () override |
| Sets active to false on component destruction. | |
| void | update (ae::q20_12_t) override |
| ae::ComponentTypeID | getType () const override |
| void | configureText (const TextConfig &config, bool loadDefaultPalette=true) |
| Configure the text system. | |
| void | drawText (const std::string &text, int x, int y, int color=TextColor::White, int xBoundary=256) |
| A wrapper for drawText in TextSystem. Draws text to the screen. | |
| void | appearText (const std::string &text, int x, int y, int color=TextColor::White, int maxX=256, int maxY=0, bool hyphenate=false) |
| A wrapper for appearText in TextSystem. Simulates text typing effect. | |
| void | appearTextSkip () |
| A wrapper for appearTextSkip in TextSystem. If a text is currently being rendered with appearText, this function will immediately render the rest of the text without delay. | |
| bool | appearTextPaused () |
| Check if the paginated text is waiting for the next page. | |
| void | appearTextNextPage () |
| Clear the text area and continue the paused text from the top of it. | |
| void | appearTextStop () |
| Stops the appearText animation immediately and clears the state. | |
| bool | appearTextDone () |
| A wrapper for appearTextDone in TextSystem. Check if the text being rendered with appearText has finished appearing. | |
| void | drawGlyph (const Glyph &glyph, int x, int y, int color, bool bold=false, bool italic=false, bool underline=false) |
| A wrapper for drawGlyph in TextSystem. Draw a single glyph to the screen. | |
| Glyph * | getGlyph (const char &c, bool bold=false) |
| Returns the Glyph struct for a given character. Useful for when drawing single characters from outside the text component. | |
| void | clearArea (int x, int y, int width, int height) |
| A wrapper for clearArea in TextSystem. Clear a rectangular area of the text video buffer. | |
| void | clearScreen () |
| A wrapper for clearScreen in TextManager. Clear the text layer by filling the video buffer with black. | |
| int | getFontSize () |
| A getter to return the font size. | |
| int | getLineSpacing () |
| A getter to return the line spacing. | |
| int | getLetterSpacing () |
| A getter to return the letter spacing. | |
| int | getSpaceWidth () |
| A getter to return the space width (width of a ' ' character). | |
| void | setLetterSpacing (int value) |
| Manually override the auto-calculated letter spacing. | |
| void | setLineSpacing (int value) |
| Manually override the auto-calculated line spacing. | |
| void | setSpaceWidth (int value) |
| Manually override the auto-calculated space width. | |
Static Public Attributes | |
| static constexpr ae::ComponentTypeID | TYPE_ID = static_cast<ae::ComponentTypeID>(ComponentType::Text) |
Protected Member Functions | |
| void | submitToManager () override |
Private Member Functions | |
| void | testBitmap () |
| A wrapper for testBitmap in TextSystem. | |
| void | testPalette () |
| A wrapper for testPalette in TextSystem. | |
Private Attributes | |
| TextSystem & | ts = TextSystem::getInstance() |
| TextManager & | tm = TextManager::getInstance() |
| std::unique_ptr< Text > | appearingText |
| std::unique_ptr< Font > | font |
| uint16_t * | videoBuffer = nullptr |
| int | fontSize = 0 |
| int | letterSpacing = 1 |
| Auto-derived from fontSize in configureText(); can be overridden manually via the setters above. | |
| int | lineSpacing = 2 |
| int | spaceWidth = 2 |
Definition at line 18 of file TextComponent.hpp.
| void TextComponent::appearText | ( | const std::string & | text, |
| int | x, | ||
| int | y, | ||
| int | color = TextColor::White, | ||
| int | maxX = 256, | ||
| int | maxY = 0, | ||
| bool | hyphenate = false ) |
A wrapper for appearText in TextSystem. Simulates text typing effect.
| text | The text to render. |
| x | The x-coordinate to start drawing the text. |
| y | The y-coordinate to start drawing the text. |
| color | The color to use for the text (default is white). |
| maxX | Right edge (exclusive) used for word wrapping (default is the screen width). |
| maxY | Bottom edge of the text area. When the next line would not fit above it, the text pauses until appearTextNextPage() is called. 0 (default) disables pagination. |
| hyphenate | Enable character-based splitting of overlong words. |
Definition at line 100 of file TextComponent.cpp.

| bool TextComponent::appearTextDone | ( | ) |
A wrapper for appearTextDone in TextSystem. Check if the text being rendered with appearText has finished appearing.
Definition at line 142 of file TextComponent.cpp.
| void TextComponent::appearTextNextPage | ( | ) |
Clear the text area and continue the paused text from the top of it.
Definition at line 132 of file TextComponent.cpp.
| bool TextComponent::appearTextPaused | ( | ) |
Check if the paginated text is waiting for the next page.
Definition at line 127 of file TextComponent.cpp.
| void TextComponent::appearTextSkip | ( | ) |
A wrapper for appearTextSkip in TextSystem. If a text is currently being rendered with appearText, this function will immediately render the rest of the text without delay.
Definition at line 122 of file TextComponent.cpp.
| void TextComponent::appearTextStop | ( | ) |
Stops the appearText animation immediately and clears the state.
Definition at line 137 of file TextComponent.cpp.

| void TextComponent::clearArea | ( | int | x, |
| int | y, | ||
| int | width, | ||
| int | height ) |
A wrapper for clearArea in TextSystem. Clear a rectangular area of the text video buffer.
| x | The x-coordinate of the top-left corner of the area to clear. |
| y | The y-coordinate of the top-left corner of the area to clear. |
| width | The width of the area to clear. |
| height | The height of the area to clear. |
Definition at line 165 of file TextComponent.cpp.
| void TextComponent::clearScreen | ( | ) |
A wrapper for clearScreen in TextManager. Clear the text layer by filling the video buffer with black.
Definition at line 170 of file TextComponent.cpp.

| void TextComponent::configureText | ( | const TextConfig & | config, |
| bool | loadDefaultPalette = true ) |
Configure the text system.
Required to call before calling start(). Sets the font, font bitmap, font palette, and font metadata information
| config | The struct containing the text configuration to apply. |
| loadDefaultPalette | Flag to load the default font palette if true |
Auto-derive spacing from fontSize, using the same ratios the old fixed defaults had at a 12px font (1/12 letter, 2/12 line, 2/12 space). Call the setters after configureText() to override any of these manually.
Definition at line 44 of file TextComponent.cpp.

|
override |
Sets active to false on component destruction.
Definition at line 37 of file TextComponent.cpp.

| void TextComponent::drawGlyph | ( | const Glyph & | glyph, |
| int | x, | ||
| int | y, | ||
| int | color, | ||
| bool | bold = false, | ||
| bool | italic = false, | ||
| bool | underline = false ) |
A wrapper for drawGlyph in TextSystem. Draw a single glyph to the screen.
| glyph | The glyph to draw. |
| x | The x-coordinate to start drawing the glyph. |
| y | The y-coordinate to start drawing the glyph. |
| color | The color to use for the glyph. |
| bold | Whether to use the bold version of the bitmap. |
| italic | Whether the glyph should be sheared to simulate italic text. |
| underline | Whether the glyph should be underlined. |
Definition at line 147 of file TextComponent.cpp.
| void TextComponent::drawText | ( | const std::string & | text, |
| int | x, | ||
| int | y, | ||
| int | color = TextColor::White, | ||
| int | xBoundary = 256 ) |
A wrapper for drawText in TextSystem. Draws text to the screen.
| text | The text to draw. |
| x | The x-coordinate to start drawing the text. |
| y | The y-coordinate to start drawing the text. |
| color | The color to use for the text (default is white). |
| xBoundary | An optional limit to the right side of a textbox, for when text is only supposed to take up an area of the screen. |
Definition at line 90 of file TextComponent.cpp.

| int TextComponent::getFontSize | ( | ) |
A getter to return the font size.
Definition at line 176 of file TextComponent.cpp.
| Glyph * TextComponent::getGlyph | ( | const char & | c, |
| bool | bold = false ) |
Returns the Glyph struct for a given character. Useful for when drawing single characters from outside the text component.
Definition at line 152 of file TextComponent.cpp.
| int TextComponent::getLetterSpacing | ( | ) |
A getter to return the letter spacing.
Definition at line 186 of file TextComponent.cpp.
| int TextComponent::getLineSpacing | ( | ) |
A getter to return the line spacing.
Definition at line 181 of file TextComponent.cpp.
| int TextComponent::getSpaceWidth | ( | ) |
A getter to return the space width (width of a ' ' character).
Definition at line 191 of file TextComponent.cpp.
|
inlineoverride |
Definition at line 33 of file TextComponent.hpp.
|
inlineoverride |
Definition at line 22 of file TextComponent.hpp.
| void TextComponent::setLetterSpacing | ( | int | value | ) |
Manually override the auto-calculated letter spacing.
| value | Pixels of horizontal space to add after each glyph. |
Definition at line 196 of file TextComponent.cpp.
| void TextComponent::setLineSpacing | ( | int | value | ) |
Manually override the auto-calculated line spacing.
| value | Pixels of vertical space to add after each line, on top of the font's line height. |
Definition at line 201 of file TextComponent.cpp.
| void TextComponent::setSpaceWidth | ( | int | value | ) |
Manually override the auto-calculated space width.
| value | Pixels of horizontal space a ' ' character takes up. |
Definition at line 206 of file TextComponent.cpp.
|
inlineoverrideprotected |
Definition at line 189 of file TextComponent.hpp.
|
private |
A wrapper for testBitmap in TextSystem.
Definition at line 211 of file TextComponent.cpp.
|
private |
A wrapper for testPalette in TextSystem.
Definition at line 216 of file TextComponent.cpp.
|
override |
Definition at line 7 of file TextComponent.cpp.
|
private |
Definition at line 197 of file TextComponent.hpp.
|
private |
Definition at line 198 of file TextComponent.hpp.
|
private |
Definition at line 200 of file TextComponent.hpp.
|
private |
Auto-derived from fontSize in configureText(); can be overridden manually via the setters above.
Definition at line 203 of file TextComponent.hpp.
|
private |
Definition at line 204 of file TextComponent.hpp.
|
private |
Definition at line 205 of file TextComponent.hpp.
|
private |
Definition at line 195 of file TextComponent.hpp.
|
private |
Definition at line 194 of file TextComponent.hpp.
|
staticconstexpr |
Definition at line 21 of file TextComponent.hpp.
|
private |
Definition at line 199 of file TextComponent.hpp.