#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, int fadeout=100) |
void | set_color (const color_t &color) |
void | set_bg_color (const color_t &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 (int time, surface screen) |
void | undraw (surface screen) |
surface | create_surface () |
bool | expired (int time) const |
void | show (const bool value) |
LABEL_SCROLL_MODE | scroll () const |
int | get_fade_time () const |
Private Member Functions | |
int | get_time_alive (int current_time) const |
int | xpos (std::size_t width) const |
SDL_Point | get_loc (int time) |
surface | get_surface (int time) |
Private Attributes | |
surface | surf_ |
surface | buf_ |
SDL_Rect | buf_pos_ |
int | fadeout_ |
int | time_start_ |
std::string | text_ |
int | font_size_ |
color_t | color_ |
color_t | bgcolor_ |
int | bgalpha_ |
double | xpos_ |
double | ypos_ |
double | xmove_ |
double | ymove_ |
int | lifetime_ |
int | width_ |
int | height_ |
SDL_Rect | clip_rect_ |
bool | visible_ |
font::ALIGN | align_ |
int | border_ |
LABEL_SCROLL_MODE | scroll_ |
bool | use_markup_ |
Definition at line 38 of file floating_label.hpp.
font::floating_label::floating_label | ( | const std::string & | text, |
const surface & | surface = nullptr |
||
) |
Definition at line 44 of file floating_label.cpp.
surface font::floating_label::create_surface | ( | ) |
Definition at line 93 of file floating_label.cpp.
References adjust_surface_alpha(), color_t::b, bgalpha_, bgcolor_, border_, clip_rect_, color_, ERR_FT, sdl::fill_surface_rect(), floating_to_fixed_point(), font::FONT_SANS_SERIF, font_size_, color_t::g, font::get_text_renderer(), height_, color_t::r, font::pango_text::render(), sdl_blit(), font::pango_text::set_alignment(), font::pango_text::set_characters_per_line(), font::pango_text::set_ellipse_mode(), font::pango_text::set_family_class(), font::pango_text::set_font_size(), font::pango_text::set_font_style(), font::pango_text::set_foreground_color(), font::pango_text::set_link_aware(), font::pango_text::set_maximum_height(), font::pango_text::set_maximum_width(), font::pango_text::set_text(), shadow_image(), font::pango_text::STYLE_NORMAL, surf_, text_, use_markup_, and width_.
Referenced by draw().
void font::floating_label::draw | ( | int | time, |
surface | screen | ||
) |
Definition at line 167 of file floating_label.cpp.
References buf_, buf_pos_, clip_rect_, sdl::create_rect(), create_surface(), get_loc(), get_surface(), sdl_blit(), sdl_copy_portion(), surf_, and visible_.
|
inline |
Definition at line 77 of file floating_label.hpp.
|
inline |
Definition at line 84 of file floating_label.hpp.
|
private |
Definition at line 207 of file floating_label.cpp.
References get_time_alive(), surf_, xmove_, xpos(), ymove_, and ypos_.
Referenced by draw().
|
private |
Definition at line 216 of file floating_label.cpp.
References adjust_surface_alpha_add(), fadeout_, get_time_alive(), lifetime_, and surf_.
Referenced by draw().
|
inlineprivate |
Definition at line 88 of file floating_label.hpp.
Referenced by get_loc(), and get_surface().
void font::floating_label::move | ( | double | xmove, |
double | ymove | ||
) |
Definition at line 75 of file floating_label.cpp.
|
inline |
Definition at line 81 of file floating_label.hpp.
|
inline |
Definition at line 67 of file floating_label.hpp.
Referenced by game_lua_kernel::intf_set_floating_label(), show_tooltip(), and gui::floating_textbox::update_location().
|
inline |
Definition at line 58 of file floating_label.hpp.
References color_t::a.
Referenced by game_lua_kernel::intf_set_floating_label(), CVideo::set_help_string(), and show_tooltip().
|
inline |
Definition at line 62 of file floating_label.hpp.
Referenced by CVideo::set_help_string(), and show_tooltip().
|
inline |
Definition at line 66 of file floating_label.hpp.
Referenced by display::announce(), game_lua_kernel::intf_set_floating_label(), playmp_controller::play_human_turn(), display::set_diagnostic(), show_tooltip(), and gui::floating_textbox::update_location().
|
inline |
Definition at line 57 of file floating_label.hpp.
Referenced by display::announce(), game_display::float_label(), game_lua_kernel::intf_set_floating_label(), playmp_controller::play_human_turn(), display::set_diagnostic(), show_tooltip(), and gui::floating_textbox::update_location().
|
inline |
Definition at line 43 of file floating_label.hpp.
Referenced by display_chat_manager::add_chat_message(), display::announce(), terrain_label::draw(), game_display::float_label(), game_lua_kernel::intf_set_floating_label(), display::set_diagnostic(), CVideo::set_help_string(), show_tooltip(), and display::update_display().
|
inline |
Definition at line 65 of file floating_label.hpp.
References h.
void font::floating_label::set_lifetime | ( | int | lifetime, |
int | fadeout = 100 |
||
) |
Definition at line 199 of file floating_label.cpp.
References fadeout_, lifetime_, and time_start_.
Referenced by display::announce(), game_display::float_label(), game_lua_kernel::intf_set_floating_label(), and playmp_controller::play_human_turn().
|
inline |
Definition at line 51 of file floating_label.hpp.
Referenced by game_display::float_label().
|
inline |
Definition at line 46 of file floating_label.hpp.
Referenced by display::announce(), game_display::float_label(), game_lua_kernel::intf_set_floating_label(), playmp_controller::play_human_turn(), display::set_diagnostic(), CVideo::set_help_string(), and gui::floating_textbox::update_location().
|
inline |
Definition at line 68 of file floating_label.hpp.
Referenced by game_display::float_label().
|
inline |
|
inline |
Definition at line 79 of file floating_label.hpp.
void font::floating_label::undraw | ( | surface | screen | ) |
Definition at line 229 of file floating_label.cpp.
References buf_, buf_pos_, clip_rect_, and sdl_blit().
|
inline |
|
private |
Definition at line 81 of file floating_label.cpp.
References align_, font::CENTER_ALIGN, font::RIGHT_ALIGN, and xpos_.
Referenced by get_loc().
|
private |
Definition at line 105 of file floating_label.hpp.
Referenced by xpos().
|
private |
Definition at line 99 of file floating_label.hpp.
Referenced by create_surface().
|
private |
Definition at line 98 of file floating_label.hpp.
Referenced by create_surface().
|
private |
Definition at line 106 of file floating_label.hpp.
Referenced by create_surface().
|
private |
Definition at line 92 of file floating_label.hpp.
|
private |
Definition at line 93 of file floating_label.hpp.
|
private |
Definition at line 103 of file floating_label.hpp.
Referenced by create_surface(), draw(), and undraw().
|
private |
Definition at line 98 of file floating_label.hpp.
Referenced by create_surface().
|
private |
Definition at line 94 of file floating_label.hpp.
Referenced by get_surface(), and set_lifetime().
|
private |
Definition at line 97 of file floating_label.hpp.
Referenced by create_surface().
|
private |
Definition at line 102 of file floating_label.hpp.
Referenced by create_surface().
|
private |
Definition at line 101 of file floating_label.hpp.
Referenced by get_surface(), and set_lifetime().
|
private |
Definition at line 107 of file floating_label.hpp.
|
private |
Definition at line 92 of file floating_label.hpp.
Referenced by create_surface(), draw(), get_loc(), and get_surface().
|
private |
Definition at line 96 of file floating_label.hpp.
Referenced by create_surface().
|
private |
Definition at line 95 of file floating_label.hpp.
Referenced by set_lifetime().
|
private |
Definition at line 108 of file floating_label.hpp.
Referenced by create_surface().
|
private |
Definition at line 104 of file floating_label.hpp.
Referenced by draw().
|
private |
Definition at line 102 of file floating_label.hpp.
Referenced by create_surface().
|
private |
Definition at line 100 of file floating_label.hpp.
Referenced by get_loc().
|
private |
Definition at line 100 of file floating_label.hpp.
|
private |
Definition at line 100 of file floating_label.hpp.
Referenced by get_loc().
|
private |
Definition at line 100 of file floating_label.hpp.