The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
font::floating_label Class Reference

#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_
 

Detailed Description

Definition at line 36 of file floating_label.hpp.

Constructor & Destructor Documentation

font::floating_label::floating_label ( const std::string text,
const surface surface = nullptr 
)

Definition at line 45 of file floating_label.cpp.

Member Function Documentation

surface font::floating_label::create_surface ( )
void font::floating_label::draw ( surface  screen)
bool font::floating_label::expired ( ) const
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.

References xpos_, and ypos_.

Referenced by undraw().

LABEL_SCROLL_MODE font::floating_label::scroll ( ) const
inline

Definition at line 91 of file floating_label.hpp.

References scroll_.

Referenced by set_scroll_mode().

void font::floating_label::set_alignment ( ALIGN  align)
inline

Definition at line 68 of file floating_label.hpp.

References align_.

Referenced by show_tooltip(), and gui::floating_textbox::update_location().

void font::floating_label::set_bg_color ( const SDL_Color &  bg_color)
inline

Definition at line 59 of file floating_label.hpp.

References bgalpha_, and bgcolor_.

Referenced by CVideo::set_help_string(), and show_tooltip().

void font::floating_label::set_border_size ( int  border)
inline

Definition at line 63 of file floating_label.hpp.

References border_.

Referenced by CVideo::set_help_string(), and show_tooltip().

void font::floating_label::set_clip_rect ( const SDL_Rect &  r)
inline
void font::floating_label::set_color ( const SDL_Color &  color)
inline
void font::floating_label::set_font_size ( int  font_size)
inline
void font::floating_label::set_height ( int  h)
inline

Definition at line 66 of file floating_label.hpp.

References h, and height_.

void font::floating_label::set_lifetime ( int  lifetime)
inline
void font::floating_label::set_move ( double  xmove,
double  ymove 
)
inline

Definition at line 49 of file floating_label.hpp.

References xmove_, and ymove_.

Referenced by game_display::float_label().

void font::floating_label::set_position ( double  xpos,
double  ypos 
)
inline
void font::floating_label::set_scroll_mode ( LABEL_SCROLL_MODE  scroll)
inline

Definition at line 69 of file floating_label.hpp.

References scroll(), and scroll_.

Referenced by game_display::float_label().

void font::floating_label::set_width ( int  w)
inline

Definition at line 65 of file floating_label.hpp.

References width_.

Referenced by show_tooltip().

void font::floating_label::show ( const bool  value)
inline

Definition at line 89 of file floating_label.hpp.

References visible_.

void font::floating_label::undraw ( surface  screen)
void font::floating_label::use_markup ( bool  b)
inline

Definition at line 70 of file floating_label.hpp.

References use_markup_.

Referenced by show_tooltip().

int font::floating_label::xpos ( size_t  width) const
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().

Member Data Documentation

font::ALIGN font::floating_label::align_
private

Definition at line 111 of file floating_label.hpp.

Referenced by set_alignment(), and xpos().

int font::floating_label::alpha_change_
private

Definition at line 109 of file floating_label.hpp.

Referenced by set_lifetime(), and undraw().

int font::floating_label::bgalpha_
private

Definition at line 104 of file floating_label.hpp.

Referenced by create_surface(), and set_bg_color().

SDL_Color font::floating_label::bgcolor_
private

Definition at line 103 of file floating_label.hpp.

Referenced by create_surface(), and set_bg_color().

int font::floating_label::border_
private

Definition at line 112 of file floating_label.hpp.

Referenced by create_surface(), and set_border_size().

surface font::floating_label::buf_
private

Definition at line 99 of file floating_label.hpp.

Referenced by draw(), and undraw().

SDL_Rect font::floating_label::clip_rect_
private

Definition at line 108 of file floating_label.hpp.

Referenced by create_surface(), draw(), set_clip_rect(), and undraw().

SDL_Color font::floating_label::color_
private

Definition at line 103 of file floating_label.hpp.

Referenced by create_surface(), and set_color().

int font::floating_label::font_size_
private

Definition at line 102 of file floating_label.hpp.

Referenced by create_surface(), and set_font_size().

int font::floating_label::height_
private

Definition at line 107 of file floating_label.hpp.

Referenced by create_surface(), and set_height().

int font::floating_label::lifetime_
private

Definition at line 106 of file floating_label.hpp.

Referenced by expired(), set_lifetime(), and undraw().

LABEL_SCROLL_MODE font::floating_label::scroll_
private

Definition at line 113 of file floating_label.hpp.

Referenced by scroll(), and set_scroll_mode().

surface font::floating_label::surf_
private

Definition at line 99 of file floating_label.hpp.

Referenced by create_surface(), draw(), and undraw().

std::string font::floating_label::text_
private

Definition at line 101 of file floating_label.hpp.

Referenced by create_surface().

bool font::floating_label::use_markup_
private

Definition at line 114 of file floating_label.hpp.

Referenced by create_surface(), and use_markup().

bool font::floating_label::visible_
private

Definition at line 110 of file floating_label.hpp.

Referenced by draw(), and show().

int font::floating_label::width_
private

Definition at line 107 of file floating_label.hpp.

Referenced by create_surface(), and set_width().

double font::floating_label::xmove_
private

Definition at line 105 of file floating_label.hpp.

Referenced by set_move(), and undraw().

double font::floating_label::xpos_
private

Definition at line 105 of file floating_label.hpp.

Referenced by move(), set_position(), and xpos().

double font::floating_label::ymove_
private

Definition at line 105 of file floating_label.hpp.

Referenced by set_move(), and undraw().

double font::floating_label::ypos_
private

Definition at line 105 of file floating_label.hpp.

Referenced by draw(), move(), set_position(), and undraw().


The documentation for this class was generated from the following files: