The Battle for Wesnoth  1.15.2+dev
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 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 (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 (std::size_t width) const
 

Private Attributes

surface surf_
 
surface buf_
 
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_
 
int alpha_change_
 
bool visible_
 
font::ALIGN align_
 
int border_
 
LABEL_SCROLL_MODE scroll_
 
bool use_markup_
 

Detailed Description

Definition at line 35 of file floating_label.hpp.

Constructor & Destructor Documentation

◆ floating_label()

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

Definition at line 43 of file floating_label.cpp.

Member Function Documentation

◆ create_surface()

surface font::floating_label::create_surface ( )

◆ draw()

void font::floating_label::draw ( surface  screen)

◆ expired()

bool font::floating_label::expired ( ) const
inline

Definition at line 77 of file floating_label.hpp.

◆ move()

void font::floating_label::move ( double  xmove,
double  ymove 
)

Definition at line 72 of file floating_label.cpp.

References xpos_, and ypos_.

Referenced by undraw().

◆ scroll()

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

Definition at line 81 of file floating_label.hpp.

◆ set_alignment()

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

Definition at line 67 of file floating_label.hpp.

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

◆ set_bg_color()

void font::floating_label::set_bg_color ( const color_t bg_color)
inline

Definition at line 58 of file floating_label.hpp.

References color_t::a.

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

◆ set_border_size()

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

Definition at line 62 of file floating_label.hpp.

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

◆ set_clip_rect()

void font::floating_label::set_clip_rect ( const SDL_Rect &  r)
inline

◆ set_color()

void font::floating_label::set_color ( const color_t color)
inline

◆ set_font_size()

void font::floating_label::set_font_size ( int  font_size)
inline

◆ set_height()

void font::floating_label::set_height ( int  h)
inline

Definition at line 65 of file floating_label.hpp.

References h.

◆ set_lifetime()

void font::floating_label::set_lifetime ( int  lifetime)
inline

◆ set_move()

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

Definition at line 48 of file floating_label.hpp.

Referenced by game_display::float_label().

◆ set_position()

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

◆ set_scroll_mode()

void font::floating_label::set_scroll_mode ( LABEL_SCROLL_MODE  scroll)
inline

Definition at line 68 of file floating_label.hpp.

Referenced by game_display::float_label().

◆ set_width()

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

Definition at line 64 of file floating_label.hpp.

References w.

Referenced by show_tooltip().

◆ show()

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

Definition at line 79 of file floating_label.hpp.

◆ undraw()

void font::floating_label::undraw ( surface  screen)

◆ use_markup()

void font::floating_label::use_markup ( bool  b)
inline

Definition at line 69 of file floating_label.hpp.

References b.

Referenced by show_tooltip().

◆ xpos()

int font::floating_label::xpos ( std::size_t  width) const
private

Definition at line 78 of file floating_label.cpp.

References align_, font::CENTER_ALIGN, font::RIGHT_ALIGN, and xpos_.

Referenced by draw(), and undraw().

Member Data Documentation

◆ align_

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

Definition at line 97 of file floating_label.hpp.

Referenced by xpos().

◆ alpha_change_

int font::floating_label::alpha_change_
private

Definition at line 95 of file floating_label.hpp.

Referenced by undraw().

◆ bgalpha_

int font::floating_label::bgalpha_
private

Definition at line 90 of file floating_label.hpp.

Referenced by create_surface().

◆ bgcolor_

color_t font::floating_label::bgcolor_
private

Definition at line 89 of file floating_label.hpp.

Referenced by create_surface().

◆ border_

int font::floating_label::border_
private

Definition at line 98 of file floating_label.hpp.

Referenced by create_surface().

◆ buf_

surface font::floating_label::buf_
private

Definition at line 86 of file floating_label.hpp.

Referenced by draw(), and undraw().

◆ clip_rect_

SDL_Rect font::floating_label::clip_rect_
private

Definition at line 94 of file floating_label.hpp.

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

◆ color_

color_t font::floating_label::color_
private

Definition at line 89 of file floating_label.hpp.

Referenced by create_surface().

◆ font_size_

int font::floating_label::font_size_
private

Definition at line 88 of file floating_label.hpp.

Referenced by create_surface().

◆ height_

int font::floating_label::height_
private

Definition at line 93 of file floating_label.hpp.

Referenced by create_surface().

◆ lifetime_

int font::floating_label::lifetime_
private

Definition at line 92 of file floating_label.hpp.

Referenced by undraw().

◆ scroll_

LABEL_SCROLL_MODE font::floating_label::scroll_
private

Definition at line 99 of file floating_label.hpp.

◆ surf_

surface font::floating_label::surf_
private

Definition at line 86 of file floating_label.hpp.

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

◆ text_

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

Definition at line 87 of file floating_label.hpp.

Referenced by create_surface().

◆ use_markup_

bool font::floating_label::use_markup_
private

Definition at line 100 of file floating_label.hpp.

Referenced by create_surface().

◆ visible_

bool font::floating_label::visible_
private

Definition at line 96 of file floating_label.hpp.

Referenced by draw().

◆ width_

int font::floating_label::width_
private

Definition at line 93 of file floating_label.hpp.

Referenced by create_surface().

◆ xmove_

double font::floating_label::xmove_
private

Definition at line 91 of file floating_label.hpp.

Referenced by undraw().

◆ xpos_

double font::floating_label::xpos_
private

Definition at line 91 of file floating_label.hpp.

Referenced by move(), and xpos().

◆ ymove_

double font::floating_label::ymove_
private

Definition at line 91 of file floating_label.hpp.

Referenced by undraw().

◆ ypos_

double font::floating_label::ypos_
private

Definition at line 91 of file floating_label.hpp.

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


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