#include <wg_renderedstring.h>
Definition at line 48 of file wg_renderedstring.h.
The vertical alignment of the text.
Definition at line 52 of file wg_renderedstring.h.
The horizontal alignment of the text.
HALIGN_LEFT | Align the text to the left of the drawing area. |
HALIGN_CENTER | Align the text with the center of the drawing area. |
HALIGN_RIGHT | Align the text with the right of the drawing area. |
Definition at line 61 of file wg_renderedstring.h.
wGui::CRenderedString::CRenderedString | ( | CFontEngine * | pFontEngine, | |
const std::wstring & | sString, | |||
EVAlign | eVertAlign = VALIGN_NORMAL , |
|||
EHAlign | eHorzAlign = HALIGN_LEFT | |||
) |
Construct a new CRenderedString object
pFontEngine | A pointer to a CFontEngine object which is used to render the string | |
sString | The string to render | |
eVertAlign | The vertical alignment | |
eHorzAlign | The horizontal alignment |
Definition at line 34 of file wg_renderedstring.cpp.
References m_pFontEngine.
void wGui::CRenderedString::Draw | ( | SDL_Surface * | pSurface, | |
const CRect & | BoundingRect, | |||
const CPoint & | OriginPoint, | |||
const CRGBColor & | FontColor = DEFAULT_LINE_COLOR | |||
) | const |
Render the string onto the given surface
pSurface | A pointer to the surface that will be drawn to | |
BoundingRect | The CRect to clip the rendered string to | |
OriginPoint | The origin of the string | |
FontColor | The color to draw the string in |
Definition at line 51 of file wg_renderedstring.cpp.
References wGui::CRGBColor::blue, wGui::CPainter::DrawPoint(), GetMetrics(), wGui::CRGBColor::green, wGui::CRect::HitTest(), m_MaskChar, m_pFontEngine, m_sString, wGui::CPainter::PAINT_NORMAL, wGui::CRGBColor::red, wGui::CRect::RELPOS_INSIDE, and wGui::CFontEngine::RenderGlyph().
void wGui::CRenderedString::GetMetrics | ( | CPoint * | pBoundedDimensions = 0 , |
|
CPoint * | pOriginOffset = 0 , |
|||
std::vector< CRect > * | pCharacterRects = 0 | |||
) | const |
Get some metrics for the rendered string
pBoundedDimensions | A pointer to a CPoint object that will receive the width and height of the rendered string | |
pOriginOffset | A pointer to a CPoint object that will receive the offset of the top left corner of the rendered string from the origin of the string | |
pCharacterRects | A pointer to a CRect vector that will receive CRects that contain each character. The corrdinates are in reference to the top left corner of the string as a whole |
Definition at line 128 of file wg_renderedstring.cpp.
References wGui::CFontEngine::GetMetrics(), HALIGN_CENTER, HALIGN_LEFT, HALIGN_RIGHT, m_MaskChar, m_pFontEngine, m_sString, wGui::CPoint::SetX(), wGui::CPoint::SetY(), VALIGN_BOTTOM, VALIGN_CENTER, VALIGN_NORMAL, and VALIGN_TOP.
Referenced by Draw(), and wGui::CMessageBox::FitToText().
unsigned int wGui::CRenderedString::GetLength | ( | void | ) | const [inline] |
Get the length of the rendered string in characters
Definition at line 90 of file wg_renderedstring.h.
References m_sString.
unsigned int wGui::CRenderedString::GetMaxFontHeight | ( | void | ) |
Get the maximum height of the font, ASCII characters 0-255
Definition at line 88 of file wg_renderedstring.cpp.
References wGui::CFontEngine::GetMetrics(), and m_pFontEngine.
unsigned int wGui::CRenderedString::GetMaxFontWidth | ( | void | ) |
Get the maximum width of the font, ASCII characters 0-255
Definition at line 108 of file wg_renderedstring.cpp.
References wGui::CFontEngine::GetMetrics(), and m_pFontEngine.
void wGui::CRenderedString::SetMaskChar | ( | wchar_t | MaskChar | ) | [inline] |
Set the mask character
MaskChar | Character to use as the mask |
Definition at line 102 of file wg_renderedstring.h.
References m_MaskChar.
wchar_t wGui::CRenderedString::GetMaskChar | ( | void | ) | const [inline] |
Return the mask character
Definition at line 106 of file wg_renderedstring.h.
References m_MaskChar.