4 #include <rag/DisplayObject.h>
5 #include <rag/ITextFont.h>
28 TextField(
const std::string& folderPath,
const std::string& descriptorFileName);
31 TextField(
const std::string& path,
float pixelHeight = 24,
float letterSpacing = 0);
36 std::vector<DropShadowFilter> getFilters();
47 enum HorzAlignment { Left = 0, Center, Right }
horzAlign;
48 enum VertAlignment { Top = 0, Middle, Bottom }
vertAlign;
66 virtual void render()
override;
68 void printText(
const std::string& text,
const glm::mat4
matrix);
70 std::vector<std::string> splitLines();
80 std::vector<std::string> lines;
81 std::vector<int> lineWidths;
85 std::vector<DropShadowFilter> filters;
91 static std::map<std::string, std::map<int, ITextFont*> > cache;
glm::mat4 matrix
The object matrix.
Definition: DisplayObject.h:194
TextField(const std::string &folderPath, const std::string &descriptorFileName)
Constructor with Bitmap fonts.
virtual void render() override
Renders the DisplayObject in the screen.
Definition: TextField.cpp:99
bool password
Use the textfield to show a password. Wildcards would be printed instead of the actual text...
Definition: TextField.h:54
bool showCursor
When true, a cursor is shown right after the last letter. Note that text width remains the same with ...
Definition: TextField.h:52
int getTextWidth()
Returns the current length of the text, for single line.
Definition: TextField.cpp:321
enum rag::TextField::VertAlignment vertAlign
The vertical alignment of the text block.
enum rag::TextField::HorzAlignment horzAlign
The horizontal alignment of the text block.
static void traceTextCache()
Debug function to know how many textures are cached by texts.
Definition: TextField.cpp:331
Interface for text fonts.
Definition: ITextFont.h:10
Core object used to display things in screen.
Definition: DisplayObject.h:23
int getLineHeight()
Returns the height of a line.
Definition: TextField.cpp:203
bool autotrim
True by default. Trims single line text when longer than reserved dimensions.
Definition: TextField.h:53
High level abstraction to render texts in display list.
Definition: TextField.h:22
Shadow effect for TextField instances.
Definition: TextField.h:10
Represents RGBA color.
Definition: Color.h:11
std::string text
The text that should be rendered.
Definition: TextField.h:50
static void reloadTextures()
When graphic context is missed (android) reloads fonts textures.
Definition: TextField.cpp:18
int getLines()
Returns the number of lines used with the current text.
Definition: TextField.cpp:197
bool multiline
Is it intended to be drawn in a single or multi-line fashion. False by default.
Definition: TextField.h:51