FIFE
|
#include <gui_font.h>
Public Member Functions | |
GuiFont (IFont *font) | |
Constructor Takes the ownership of given font. More... | |
virtual | ~GuiFont () |
int32_t | getStringIndexAt (const std::string &text, int32_t x) const |
void | drawString (gcn::Graphics *graphics, const std::string &text, int32_t x, int32_t y) |
void | drawMultiLineString (gcn::Graphics *graphics, const std::string &text, int32_t x, int32_t y) |
std::string | splitTextToWidth (const std::string &text, int32_t render_width) |
void | setRowSpacing (int32_t spacing) |
Sets the spacing between rows in pixels. More... | |
int32_t | getRowSpacing () const |
Gets the spacing between rows in pixels. More... | |
void | setGlyphSpacing (int32_t spacing) |
Sets the spacing between letters in pixels. More... | |
int32_t | getGlyphSpacing () const |
Gets the spacing between letters in pixels. More... | |
void | setAntiAlias (bool antiAlias) |
Sets the use of anti aliasing. More... | |
bool | isAntiAlias () |
Checks if anti aliasing is used. More... | |
Image * | getAsImage (const std::string &text) |
Gets given text as Image The rsulting image is pooled, so it's not that time critical. More... | |
Image * | getAsImageMultiline (const std::string &text) |
Gets given text as Image. More... | |
void | setColor (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255) |
Set the color the text should be rendered in. More... | |
SDL_Color | getColor () const |
Get the color the text was rendered in. More... | |
int32_t | getWidth (const std::string &text) const |
gets width of given text More... | |
int32_t | getHeight () const |
gets height of this font More... | |
void | invalidate () |
![]() | |
virtual | ~IFont () |
Private Attributes | |
IFont * | m_font |
Definition at line 39 of file gui_font.h.
FIFE::GuiFont::GuiFont | ( | IFont * | font | ) |
Constructor Takes the ownership of given font.
Definition at line 38 of file gui_font.cpp.
|
virtual |
Definition at line 42 of file gui_font.cpp.
References m_font.
void FIFE::GuiFont::drawMultiLineString | ( | gcn::Graphics * | graphics, |
const std::string & | text, | ||
int32_t | x, | ||
int32_t | y | ||
) |
Definition at line 72 of file gui_font.cpp.
References getAsImageMultiline(), FIFE::Image::getHeight(), getRowSpacing(), FIFE::Image::getWidth(), FIFE::RectType< T >::h, FIFE::RectType< T >::intersects(), FIFE::Image::render(), FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.
Referenced by gcn::ClickLabel::draw().
void FIFE::GuiFont::drawString | ( | gcn::Graphics * | graphics, |
const std::string & | text, | ||
int32_t | x, | ||
int32_t | y | ||
) |
Definition at line 50 of file gui_font.cpp.
References getAsImage(), getHeight(), getRowSpacing(), getWidth(), FIFE::RectType< T >::h, FIFE::RectType< T >::intersects(), FIFE::Image::render(), FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.
|
virtual |
Gets given text as Image The rsulting image is pooled, so it's not that time critical.
Implements FIFE::IFont.
Definition at line 118 of file gui_font.cpp.
References FIFE::IFont::getAsImage(), and m_font.
Referenced by drawString().
|
virtual |
Gets given text as Image.
Text is splitted on multiple lines based "\n" marks The rsulting image is pooled, so it's not that time critical
Implements FIFE::IFont.
Definition at line 122 of file gui_font.cpp.
References FIFE::IFont::getAsImageMultiline(), and m_font.
Referenced by gcn::ClickLabel::adjustSize(), and drawMultiLineString().
|
virtual |
Get the color the text was rendered in.
Implements FIFE::IFont.
Definition at line 134 of file gui_font.cpp.
References FIFE::IFont::getColor(), and m_font.
|
virtual |
Gets the spacing between letters in pixels.
Implements FIFE::IFont.
Definition at line 106 of file gui_font.cpp.
References FIFE::IFont::getGlyphSpacing(), and m_font.
|
virtual |
gets height of this font
Implements FIFE::IFont.
Definition at line 142 of file gui_font.cpp.
References FIFE::IFont::getHeight(), and m_font.
Referenced by drawString().
|
virtual |
Gets the spacing between rows in pixels.
Implements FIFE::IFont.
Definition at line 98 of file gui_font.cpp.
References FIFE::IFont::getRowSpacing(), and m_font.
Referenced by drawMultiLineString(), and drawString().
|
virtual |
Implements FIFE::IFont.
Definition at line 46 of file gui_font.cpp.
References FIFE::IFont::getStringIndexAt(), and m_font.
|
virtual |
gets width of given text
Implements FIFE::IFont.
Definition at line 138 of file gui_font.cpp.
References FIFE::IFont::getWidth(), and m_font.
Referenced by drawString().
|
virtual |
Implements FIFE::IFont.
Definition at line 146 of file gui_font.cpp.
References FIFE::IFont::invalidate(), and m_font.
|
virtual |
Checks if anti aliasing is used.
Implements FIFE::IFont.
Definition at line 114 of file gui_font.cpp.
References FIFE::IFont::isAntiAlias(), and m_font.
|
virtual |
Sets the use of anti aliasing.
antiAlias | true for use of anti aliasing. |
Implements FIFE::IFont.
Definition at line 110 of file gui_font.cpp.
References m_font, and FIFE::IFont::setAntiAlias().
|
virtual |
Set the color the text should be rendered in.
Implements FIFE::IFont.
Definition at line 130 of file gui_font.cpp.
References m_font, and FIFE::IFont::setColor().
Referenced by FIFE::Console::Console().
|
virtual |
Sets the spacing between letters in pixels.
Default is 0 pixels. The spacing can be negative.
spacing | the spacing in pixels. |
Implements FIFE::IFont.
Definition at line 102 of file gui_font.cpp.
References m_font, and FIFE::IFont::setGlyphSpacing().
|
virtual |
Sets the spacing between rows in pixels.
Default is 0 pixels. The spacing can be negative.
spacing | the spacing in pixels. |
Implements FIFE::IFont.
Definition at line 94 of file gui_font.cpp.
References m_font, and FIFE::IFont::setRowSpacing().
|
virtual |
Implements FIFE::IFont.
Definition at line 126 of file gui_font.cpp.
References m_font, and FIFE::IFont::splitTextToWidth().
Referenced by gcn::ClickLabel::wrapText().
|
private |
Definition at line 67 of file gui_font.h.
Referenced by getAsImage(), getAsImageMultiline(), getColor(), getGlyphSpacing(), getHeight(), getRowSpacing(), getStringIndexAt(), getWidth(), invalidate(), isAntiAlias(), setAntiAlias(), setColor(), setGlyphSpacing(), setRowSpacing(), splitTextToWidth(), and ~GuiFont().