#include <floating_label.hpp>
Public Member Functions | |
floating_label (const std::string &text, const surface &surface=nullptr) | |
void | set_font_size (int font_size) |
void | set_position (double xpos, double ypos) |
void | set_move (double xmove, double ymove) |
void | set_lifetime (int lifetime) |
void | set_color (const SDL_Color &color) |
void | set_bg_color (const SDL_Color &bg_color) |
void | set_border_size (int border) |
void | set_width (int w) |
void | set_height (int h) |
void | set_clip_rect (const SDL_Rect &r) |
void | set_alignment (ALIGN align) |
void | set_scroll_mode (LABEL_SCROLL_MODE scroll) |
void | use_markup (bool b) |
void | move (double xmove, double ymove) |
void | draw (surface screen) |
void | undraw (surface screen) |
surface | create_surface () |
bool | expired () const |
void | show (const bool value) |
LABEL_SCROLL_MODE | scroll () const |
Private Member Functions | |
int | xpos (size_t width) const |
Private Attributes | |
surface | surf_ |
surface | buf_ |
std::string | text_ |
int | font_size_ |
SDL_Color | color_ |
SDL_Color | bgcolor_ |
int | bgalpha_ |
double | xpos_ |
double | ypos_ |
double | xmove_ |
double | ymove_ |
int | lifetime_ |
int | width_ |
int | height_ |
SDL_Rect | clip_rect_ |
int | alpha_change_ |
bool | visible_ |
font::ALIGN | align_ |
int | border_ |
LABEL_SCROLL_MODE | scroll_ |
bool | use_markup_ |
Definition at line 36 of file floating_label.hpp.
font::floating_label::floating_label | ( | const std::string & | text, |
const surface & | surface = nullptr |
||
) |
Definition at line 45 of file floating_label.cpp.
surface font::floating_label::create_surface | ( | ) |
Definition at line 154 of file floating_label.cpp.
References adjust_surface_alpha(), bgalpha_, bgcolor_, blit_surface(), border_, clip_rect_, color_, create_neutral_surface(), create_optimized_surface(), sdl::create_rect(), ERR_FT, sdl::fill_rect(), font_size_, ftofxp, height_, surface::null(), font::ttext::render(), SDL_SetAlpha(), SDL_SRCALPHA, font::ttext::set_font_size(), font::ttext::set_foreground_color(), font::ttext::set_maximum_height(), font::ttext::set_maximum_width(), font::ttext::set_text(), shadow_image(), surf_, text_, use_markup_, and width_.
Referenced by draw().
Definition at line 254 of file floating_label.cpp.
References surface::assign(), buf_, clip_rect_, create_compatible_surface(), sdl::create_rect(), create_surface(), sdl_blit(), sdl_copy_portion(), surf_, update_rect(), visible_, xpos(), and ypos_.
|
inline |
Definition at line 87 of file floating_label.hpp.
References lifetime_.
void font::floating_label::move | ( | double | xmove, |
double | ymove | ||
) |
Definition at line 62 of file floating_label.cpp.
Referenced by undraw().
|
inline |
Definition at line 91 of file floating_label.hpp.
References scroll_.
Referenced by set_scroll_mode().
Definition at line 68 of file floating_label.hpp.
References align_.
Referenced by show_tooltip(), and gui::floating_textbox::update_location().
|
inline |
Definition at line 59 of file floating_label.hpp.
References bgalpha_, and bgcolor_.
Referenced by CVideo::set_help_string(), and show_tooltip().
Definition at line 63 of file floating_label.hpp.
References border_.
Referenced by CVideo::set_help_string(), and show_tooltip().
|
inline |
Definition at line 67 of file floating_label.hpp.
References clip_rect_.
Referenced by display::announce(), game_lua_kernel::intf_print(), playmp_controller::play_human_turn(), display::set_diagnostic(), show_tooltip(), and gui::floating_textbox::update_location().
|
inline |
Definition at line 58 of file floating_label.hpp.
References color_.
Referenced by display::announce(), terrain_label::draw(), game_display::float_label(), game_lua_kernel::intf_print(), playmp_controller::play_human_turn(), display::set_diagnostic(), show_tooltip(), and gui::floating_textbox::update_location().
Definition at line 41 of file floating_label.hpp.
References gui::font_size, and font_size_.
Referenced by display_chat_manager::add_chat_message(), display::announce(), game_display::float_label(), game_lua_kernel::intf_print(), display::set_diagnostic(), CVideo::set_help_string(), show_tooltip(), and display::update_display().
Definition at line 66 of file floating_label.hpp.
Definition at line 54 of file floating_label.hpp.
References alpha_change_, and lifetime_.
Referenced by display::announce(), game_display::float_label(), game_lua_kernel::intf_print(), and playmp_controller::play_human_turn().
|
inline |
Definition at line 49 of file floating_label.hpp.
References xmove_, and ymove_.
Referenced by game_display::float_label().
|
inline |
Definition at line 44 of file floating_label.hpp.
References xpos(), xpos_, and ypos_.
Referenced by display::announce(), game_display::float_label(), game_lua_kernel::intf_print(), playmp_controller::play_human_turn(), display::set_diagnostic(), CVideo::set_help_string(), and gui::floating_textbox::update_location().
|
inline |
Definition at line 69 of file floating_label.hpp.
References scroll(), and scroll_.
Referenced by game_display::float_label().
|
inline |
Definition at line 89 of file floating_label.hpp.
References visible_.
Definition at line 293 of file floating_label.cpp.
References adjust_surface_alpha_add(), alpha_change_, surface::assign(), buf_, clip_rect_, sdl::create_rect(), lifetime_, move(), sdl_blit(), surf_, update_rect(), xmove_, xpos(), ymove_, and ypos_.
|
inline |
Definition at line 70 of file floating_label.hpp.
References use_markup_.
Referenced by show_tooltip().
|
private |
Definition at line 68 of file floating_label.cpp.
References align_, font::CENTER_ALIGN, int(), font::RIGHT_ALIGN, and xpos_.
Referenced by draw(), set_position(), and undraw().
|
private |
Definition at line 111 of file floating_label.hpp.
Referenced by set_alignment(), and xpos().
|
private |
Definition at line 109 of file floating_label.hpp.
Referenced by set_lifetime(), and undraw().
|
private |
Definition at line 104 of file floating_label.hpp.
Referenced by create_surface(), and set_bg_color().
|
private |
Definition at line 103 of file floating_label.hpp.
Referenced by create_surface(), and set_bg_color().
|
private |
Definition at line 112 of file floating_label.hpp.
Referenced by create_surface(), and set_border_size().
|
private |
Definition at line 99 of file floating_label.hpp.
|
private |
Definition at line 108 of file floating_label.hpp.
Referenced by create_surface(), draw(), set_clip_rect(), and undraw().
|
private |
Definition at line 103 of file floating_label.hpp.
Referenced by create_surface(), and set_color().
|
private |
Definition at line 102 of file floating_label.hpp.
Referenced by create_surface(), and set_font_size().
|
private |
Definition at line 107 of file floating_label.hpp.
Referenced by create_surface(), and set_height().
|
private |
Definition at line 106 of file floating_label.hpp.
Referenced by expired(), set_lifetime(), and undraw().
|
private |
Definition at line 113 of file floating_label.hpp.
Referenced by scroll(), and set_scroll_mode().
|
private |
Definition at line 99 of file floating_label.hpp.
Referenced by create_surface(), draw(), and undraw().
|
private |
Definition at line 101 of file floating_label.hpp.
Referenced by create_surface().
|
private |
Definition at line 114 of file floating_label.hpp.
Referenced by create_surface(), and use_markup().
|
private |
Definition at line 110 of file floating_label.hpp.
|
private |
Definition at line 107 of file floating_label.hpp.
Referenced by create_surface(), and set_width().
|
private |
Definition at line 105 of file floating_label.hpp.
Referenced by set_move(), and undraw().
|
private |
Definition at line 105 of file floating_label.hpp.
Referenced by move(), set_position(), and xpos().
|
private |
Definition at line 105 of file floating_label.hpp.
Referenced by set_move(), and undraw().
|
private |
Definition at line 105 of file floating_label.hpp.
Referenced by draw(), move(), set_position(), and undraw().