#include "SDL.h"
#include "SDL_ttf.h"
#include "sdl_utils.hpp"
#include "serialization/string_utils.hpp"
#include <string>
#include <vector>
Go to the source code of this file.
Namespaces | |
namespace | font |
Classes | |
struct | font::manager |
struct | font::manager::error |
struct | font::floating_label_context |
structure which will hide all current floating labels, and cause floating labels instantiated after it is created to be displayed More... | |
Enumerations | |
enum | font::ALIGN { font::LEFT_ALIGN, font::CENTER_ALIGN, font::RIGHT_ALIGN } |
enum | font::LABEL_SCROLL_MODE { font::ANCHOR_LABEL_SCREEN, font::ANCHOR_LABEL_MAP } |
enum | font::CACHE { font::CACHE_LOBBY, font::CACHE_GAME } |
Functions | |
int | font::relative_size (int size) |
surface | font::get_rendered_text (const std::string &str, int size, const SDL_Color &colour, int style) |
SDL_Rect | font::draw_text_line (surface gui_surface, const SDL_Rect &area, int size, const SDL_Color &colour, const std::string &text, int x, int y, bool use_tooltips, int style) |
SDL_Rect | font::draw_text_line (CVideo *gui, const SDL_Rect &area, int size, const SDL_Color &colour, const std::string &text, int x, int y, bool use_tooltips, int style) |
int | font::get_max_height (int size) |
int | font::line_width (const std::string &line, int font_size, int style=TTF_STYLE_NORMAL) |
Determine the width of a line of text given a certain font size. | |
SDL_Rect | font::line_size (const std::string &line, int font_size, int style=TTF_STYLE_NORMAL) |
Determine the size of a line of text given a certain font size. | |
std::string | font::make_text_ellipsis (const std::string &text, int font_size, int max_width, bool with_tags=true) |
If the text excedes the specified max width, end it with an ellipsis (. | |
int | font::add_floating_label (const std::string &text, int font_size, const SDL_Color &colour, double xpos, double ypos, double xmove, double ymove, int lifetime, const SDL_Rect &clip_rect, ALIGN alignment=CENTER_ALIGN, const SDL_Color *bg_colour=NULL, int border_size=0, LABEL_SCROLL_MODE scroll_mode=ANCHOR_LABEL_SCREEN) |
add a label floating on the screen above everything else. | |
void | font::move_floating_label (int handle, double xmove, double ymove) |
moves the floating label given by 'handle' by (xmove,ymove) | |
void | font::scroll_floating_labels (double xmove, double ymove) |
moves all floating labels that have 'scroll_mode' set to ANCHOR_LABEL_MAP | |
void | font::remove_floating_label (int handle) |
removes the floating label given by 'handle' from the screen | |
void | font::show_floating_label (int handle, bool show) |
hides or shows a floating label | |
SDL_Rect | font::get_floating_label_rect (int handle) |
void | font::draw_floating_labels (surface screen) |
void | font::undraw_floating_labels (surface screen) |
bool | font::load_font_config () |
void | font::cache_mode (CACHE mode) |
Variables | |
const int | font::SIZE_NORMAL = 14 |
const int | font::SIZE_TINY = relative_size(10) |
const int | font::SIZE_SMALL = relative_size(12) |
const int | font::SIZE_15 = relative_size(15) |
const int | font::SIZE_PLUS = relative_size(16) |
const int | font::SIZE_LARGE = relative_size(18) |
const int | font::SIZE_XLARGE = relative_size(24) |
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |