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

Represents and contains information about image labels used in story screen parts. More...

#include <part.hpp>

Classes

struct  render_input
 

Public Member Functions

 floating_image (const config &cfg)
 WML-based constructor. More...
 
 floating_image (const floating_image &fi)
 Copy constructor. More...
 
floating_imageoperator= (const floating_image &fi)
 
int ref_x () const
 Returns the referential X coordinate of the image. More...
 
int ref_y () const
 Returns the referential Y coordinate of the image. More...
 
bool autoscale () const
 Whether the image should be automatically scaled as much as the storyscreen background is. More...
 
bool centered () const
 Whether the image coordinates specify the location of its center (true) or top-left corner (false). More...
 
int display_delay () const
 Delay before displaying, in milliseconds. More...
 
render_input get_render_input (double xscale, double yscale, SDL_Rect &dst_rect) const
 Gets a render_input object for use by the rendering code after applying any geometric transformations required. More...
 

Private Member Functions

void assign (const floating_image &fi)
 Copy constructor and operator=() implementation details. More...
 

Private Attributes

std::string file_
 
int x_
 
int y_
 
int delay_
 
bool autoscaled_
 
bool centered_
 

Detailed Description

Represents and contains information about image labels used in story screen parts.

Definition at line 40 of file part.hpp.

Constructor & Destructor Documentation

storyscreen::floating_image::floating_image ( const config cfg)

WML-based constructor.

Parameters
cfgObject corresponding to a [image] block's contents from a [part] node.

Definition at line 50 of file part.cpp.

storyscreen::floating_image::floating_image ( const floating_image fi)

Copy constructor.

Definition at line 39 of file part.cpp.

References assign().

Member Function Documentation

void storyscreen::floating_image::assign ( const floating_image fi)
private

Copy constructor and operator=() implementation details.

Definition at line 60 of file part.cpp.

References autoscaled_, centered_, delay_, file_, x_, and y_.

Referenced by floating_image(), and operator=().

bool storyscreen::floating_image::autoscale ( ) const
inline

Whether the image should be automatically scaled as much as the storyscreen background is.

Definition at line 90 of file part.hpp.

References autoscaled_.

bool storyscreen::floating_image::centered ( ) const
inline

Whether the image coordinates specify the location of its center (true) or top-left corner (false).

Definition at line 96 of file part.hpp.

References centered_.

int storyscreen::floating_image::display_delay ( ) const
inline

Delay before displaying, in milliseconds.

Definition at line 101 of file part.hpp.

References delay_.

Referenced by storyscreen::part_ui::render_floating_images().

floating_image::render_input storyscreen::floating_image::get_render_input ( double  xscale,
double  yscale,
SDL_Rect &  dst_rect 
) const

Gets a render_input object for use by the rendering code after applying any geometric transformations required.

Definition at line 69 of file part.cpp.

References autoscaled_, centered_, file_, image::get_image(), storyscreen::floating_image::render_input::image, surface::null(), storyscreen::floating_image::render_input::rect, scale_surface(), x_, and y_.

floating_image& storyscreen::floating_image::operator= ( const floating_image fi)
inline

Definition at line 65 of file part.hpp.

References assign().

int storyscreen::floating_image::ref_x ( ) const
inline

Returns the referential X coordinate of the image.

The actual (corrected) value is determined at render time - see get_render_input().

Definition at line 74 of file part.hpp.

References x_.

int storyscreen::floating_image::ref_y ( ) const
inline

Returns the referential Y coordinate of the image.

The actual (corrected) value is determined at render time - see get_render_input().

Definition at line 82 of file part.hpp.

References y_.

Member Data Documentation

bool storyscreen::floating_image::autoscaled_
private

Definition at line 113 of file part.hpp.

Referenced by assign(), autoscale(), and get_render_input().

bool storyscreen::floating_image::centered_
private

Definition at line 114 of file part.hpp.

Referenced by assign(), centered(), and get_render_input().

int storyscreen::floating_image::delay_
private

Definition at line 112 of file part.hpp.

Referenced by assign(), and display_delay().

std::string storyscreen::floating_image::file_
private

Definition at line 110 of file part.hpp.

Referenced by assign(), and get_render_input().

int storyscreen::floating_image::x_
private

Definition at line 111 of file part.hpp.

Referenced by assign(), get_render_input(), and ref_x().

int storyscreen::floating_image::y_
private

Definition at line 111 of file part.hpp.

Referenced by assign(), get_render_input(), and ref_y().


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