![]() |
DDNet documentation
|
#include <ui.h>
Public Member Functions | |
| CCachedText ()=default | |
| CCachedText (const CCachedText &)=delete | |
| CCachedText & | operator= (const CCachedText &)=delete |
| void | Update (ITextRender *pTextRender, const char *pText, float FontSize, float LineWidth=-1.0f, int CursorFlags=TEXTFLAG_RENDER) |
| void | Render (ITextRender *pTextRender, vec2 Pos, ColorRGBA Color) const |
| void | Reset (ITextRender *pTextRender) |
| float | Width () const |
| float | MaxCharacterHeight () const |
Private Attributes | |
| STextContainerIndex | m_TextContainerIndex |
| std::string | m_Text |
| float | m_FontSize = -1.0f |
| float | m_LineWidth = -1.0f |
| int | m_CursorFlags = 0 |
| STextBoundingBox | m_BoundingBox = {0.0f, 0.0f, 0.0f, 0.0f} |
| float | m_MaxCharacterHeight = 0.0f |
Text that keeps its text container across frames and is only rebuilt when the text or its layout changes, for text that is rendered every frame. The color is applied when rendering, so changing it does not rebuild the container.
The container must be released with Reset before the text render drops its containers, which happens on window resize and language change.
|
default |
|
delete |
|
inline |
|
delete |
| void CCachedText::Render | ( | ITextRender * | pTextRender, |
| vec2 | Pos, | ||
| ColorRGBA | Color ) const |
| void CCachedText::Reset | ( | ITextRender * | pTextRender | ) |
| void CCachedText::Update | ( | ITextRender * | pTextRender, |
| const char * | pText, | ||
| float | FontSize, | ||
| float | LineWidth = -1.0f, | ||
| int | CursorFlags = TEXTFLAG_RENDER ) |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |