The Battle for Wesnoth  1.19.5+dev
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>

Public Member Functions

 floating_image (const config &cfg)
 WML-based constructor. More...
 
 floating_image (const floating_image &fi)=default
 
 floating_image (floating_image &&fi)=default
 
floating_imageoperator= (const floating_image &fi)
 
std::string file () const
 
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 resize_with_background () const
 If true, the size of the image is changed in the same way that the ref_x and ref_y are mapped to use the base layer's pixels as the coordinate system. More...
 
bool centered () const
 Whether the image coordinates specify the location of its center (true) or top-left corner (false). More...
 
const std::chrono::milliseconds & display_delay () const
 Delay after displaying this image and before displaying the next image, in milliseconds. 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_
 
std::chrono::milliseconds delay_
 
bool resize_with_background_
 
bool centered_
 

Detailed Description

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

Definition at line 38 of file part.hpp.

Constructor & Destructor Documentation

◆ floating_image() [1/3]

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 28 of file part.cpp.

◆ floating_image() [2/3]

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

◆ floating_image() [3/3]

storyscreen::floating_image::floating_image ( floating_image &&  fi)
default

Member Function Documentation

◆ assign()

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

Copy constructor and operator=() implementation details.

Referenced by operator=().

◆ centered()

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 94 of file part.hpp.

References centered_.

◆ display_delay()

const std::chrono::milliseconds& storyscreen::floating_image::display_delay ( ) const
inline

Delay after displaying this image and before displaying the next image, in milliseconds.

Definition at line 103 of file part.hpp.

References delay_.

◆ file()

std::string storyscreen::floating_image::file ( ) const
inline

Definition at line 57 of file part.hpp.

References file_.

◆ operator=()

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

Definition at line 51 of file part.hpp.

References assign().

◆ ref_x()

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.

Definition at line 66 of file part.hpp.

References x_.

◆ ref_y()

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.

Definition at line 75 of file part.hpp.

References y_.

◆ resize_with_background()

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

If true, the size of the image is changed in the same way that the ref_x and ref_y are mapped to use the base layer's pixels as the coordinate system.

Definition at line 85 of file part.hpp.

References resize_with_background_.

Member Data Documentation

◆ centered_

bool storyscreen::floating_image::centered_
private

Definition at line 113 of file part.hpp.

Referenced by centered().

◆ delay_

std::chrono::milliseconds storyscreen::floating_image::delay_
private

Definition at line 111 of file part.hpp.

Referenced by display_delay().

◆ file_

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

Definition at line 109 of file part.hpp.

Referenced by file().

◆ resize_with_background_

bool storyscreen::floating_image::resize_with_background_
private

Definition at line 112 of file part.hpp.

Referenced by resize_with_background().

◆ x_

int storyscreen::floating_image::x_
private

Definition at line 110 of file part.hpp.

Referenced by ref_x().

◆ y_

int storyscreen::floating_image::y_
private

Definition at line 110 of file part.hpp.

Referenced by ref_y().


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