15 #define GETTEXT_DOMAIN "wesnoth-lib"
19 #include "widgets/label.hpp"
73 if (!
text_.empty() && loc.w > 0 && loc.h > 0)
75 video().draw_texture(text_image_, loc.x, loc.y);
97 text_image_ = txt.render_as_texture();
SDL_Rect text_area(const std::string &text, int size, int style)
Calculate the size of a text (in pixels) if it were to be drawn.
const SDL_Color & set_color(const SDL_Color &color)
const std::string & set_text(const std::string &text)
static surface render_text(const std::string &text, int fontsize, const SDL_Color &color, int style, bool use_markup)
label(CVideo &video, const std::string &text, int size=font::SIZE_NORMAL, const SDL_Color &color=font::NORMAL_COLOR, const bool auto_join=true)
const SDL_Color & get_color() const
ttext & set_font_size(const unsigned font_size)
tformula< t_string > text_
The text to draw.
const SDL_Color DISABLED_COLOR
const std::string & get_text() const
SDL_Rect draw_text(surface &dst, const SDL_Rect &area, int size, const SDL_Color &color, const std::string &txt, int x, int y, bool use_tooltips, int style)
Function to draw text on a surface.
virtual void draw_contents()
bool set_text(const std::string &text, const bool markedup)
Sets the text to render.
GLsizei const GLcharARB ** string
ttext & set_foreground_color(const Uint32 color)