HoverRace
2.0
|
Character-by-character text renderer. More...
#include <TypeCase.h>
Public Member Functions | |
TypeCase (const UiFont &font, int width, int height) | |
Constructor. More... | |
TypeCase (const TypeCase &)=delete | |
virtual | ~TypeCase () |
virtual MR_UInt32 | CountTextures () const =0 |
Count the number of active backing textures. More... | |
int | GetHeight () const |
Retrieve the height of each of the backing textures. More... | |
int | GetWidth () const |
Retrieve the width of each of the backing textures. More... | |
TypeCase & | operator= (const TypeCase &)=delete |
virtual void | Prepare (const std::string &s, TypeLine *rects=nullptr)=0 |
Prepare a string to be rendered. More... | |
virtual void | Render (const TypeLine &s, const Color color, int x, int y, boost::optional< size_t > caret={})=0 |
Render a string. More... | |
virtual void | RenderTexture (MR_UInt32 idx, int x, int y, double scale=1.0)=0 |
Renders the backing texture (for debugging purposes). More... | |
Protected Attributes | |
const UiFont | font |
const int | height |
const int | width |
Character-by-character text renderer.
|
inline |
Constructor.
font | The font. |
width | The width of the backing texture. |
height | The height of the backing texture. |
|
delete |
|
inlinevirtual |
|
pure virtual |
Count the number of active backing textures.
Implemented in HoverRace::Display::SDL::SdlTypeCase.
|
inline |
Retrieve the height of each of the backing textures.
|
inline |
Retrieve the width of each of the backing textures.
|
pure virtual |
Prepare a string to be rendered.
If rects
is omitted, then this can be used to preemptively add characters to the type case before they are used later.
s | The text string that will be rendered. | |
[out] | rects | Optional destination buffer for the prepared text. |
Implemented in HoverRace::Display::SDL::SdlTypeCase.
|
pure virtual |
Render a string.
Only characters which have been previously added via AddChars() will be rendered.
s | The string to render. |
color | The color of the string. |
x | The screen X coordinate of the upper-left corner. |
y | The screen Y coordinate of the upper-left corner. |
caret | The optional caret position. |
Implemented in HoverRace::Display::SDL::SdlTypeCase.
|
pure virtual |
Renders the backing texture (for debugging purposes).
idx | The texture index. |
x | The x coordinate. |
y | The y coordinate. |
scale | The scaling factor. |
Implemented in HoverRace::Display::SDL::SdlTypeCase.
|
protected |
|
protected |
|
protected |