lxgui
Public Member Functions | List of all members
lxgui::gui::backdrop Class Reference

Draws borders and background of a frame. More...

#include <gui_backdrop.hpp>

Public Member Functions

 backdrop (frame &parent)
 Constructor. More...
 
 backdrop (const backdrop &)=delete
 Non-copiable. More...
 
 backdrop (backdrop &&)=delete
 Non-movable. More...
 
backdropoperator= (const backdrop &)=delete
 Non-copiable. More...
 
backdropoperator= (backdrop &&)=delete
 Non-movable. More...
 
void copy_from (const backdrop &other)
 Copies a backdrop's parameters into this one (inheritance). More...
 
void set_background (const std::string &background_file)
 Sets the background texture. More...
 
const std::string & get_background_file () const
 Returns this backdrop's background file. More...
 
void set_background_color (const color &c)
 Sets the background color. More...
 
color get_background_color () const
 Returns the background color. More...
 
void set_background_tilling (bool is_tilling)
 Enables tilling for the background texture. More...
 
bool is_background_tilling () const
 Checks if tilling is enabled for the background texture. More...
 
void set_tile_size (float tile_size)
 Sets the apparent tile size. More...
 
float get_tile_size () const
 Returns this backdrop's tile size. More...
 
void set_background_insets (const bounds2f &insets)
 Sets insets for the background texture. More...
 
const bounds2fget_background_insets () const
 Returns this backdrop's background insets. More...
 
void set_edge_insets (const bounds2f &insets)
 Sets insets for the edge texture. More...
 
const bounds2fget_edge_insets () const
 Returns this backdrop's edge insets. More...
 
void set_edge (const std::string &edge_file)
 Sets the edge/corner texture. More...
 
const std::string & get_edge_file () const
 Returns this backdrop's edge file. More...
 
void set_edge_color (const color &c)
 Sets the edge color. More...
 
color get_edge_color () const
 Returns the edge color. More...
 
void set_edge_size (float edge_size)
 Sets the apparent edge size. More...
 
float get_edge_size () const
 Returns this backdrop's edge size. More...
 
void set_vertex_color (const color &c)
 Sets the color to be multiplied to all drawn vertices. More...
 
void render () const
 Renders this backdrop on the current render target. More...
 
void notify_borders_updated () const
 Tells this backdrop that its parent frame has changed dimensions. More...
 

Detailed Description

Draws borders and background of a frame.

Definition at line 18 of file gui_backdrop.hpp.

Constructor & Destructor Documentation

◆ backdrop() [1/3]

lxgui::gui::backdrop::backdrop ( frame parent)
explicit

Constructor.

Parameters
parentThe frame it is linked to

Definition at line 13 of file gui_backdrop.cpp.

◆ backdrop() [2/3]

lxgui::gui::backdrop::backdrop ( const backdrop )
delete

Non-copiable.

◆ backdrop() [3/3]

lxgui::gui::backdrop::backdrop ( backdrop &&  )
delete

Non-movable.

Member Function Documentation

◆ copy_from()

void lxgui::gui::backdrop::copy_from ( const backdrop other)

Copies a backdrop's parameters into this one (inheritance).

Parameters
otherThe backdrop to copy

Definition at line 15 of file gui_backdrop.cpp.

◆ get_background_color()

color lxgui::gui::backdrop::get_background_color ( ) const

Returns the background color.

Returns
The background color

Definition at line 82 of file gui_backdrop.cpp.

◆ get_background_file()

const std::string & lxgui::gui::backdrop::get_background_file ( ) const

Returns this backdrop's background file.

Returns
This backdrop's background file

Definition at line 65 of file gui_backdrop.cpp.

◆ get_background_insets()

const bounds2f & lxgui::gui::backdrop::get_background_insets ( ) const

Returns this backdrop's background insets.

Returns
This backdrop's background insets

Definition at line 118 of file gui_backdrop.cpp.

◆ get_edge_color()

color lxgui::gui::backdrop::get_edge_color ( ) const

Returns the edge color.

Returns
The edge color

Definition at line 196 of file gui_backdrop.cpp.

◆ get_edge_file()

const std::string & lxgui::gui::backdrop::get_edge_file ( ) const

Returns this backdrop's edge file.

Returns
This backdrop's edge file

Definition at line 177 of file gui_backdrop.cpp.

◆ get_edge_insets()

const bounds2f & lxgui::gui::backdrop::get_edge_insets ( ) const

Returns this backdrop's edge insets.

Returns
This backdrop's edge insets

Definition at line 130 of file gui_backdrop.cpp.

◆ get_edge_size()

float lxgui::gui::backdrop::get_edge_size ( ) const

Returns this backdrop's edge size.

Returns
This backdrop's edge size

Definition at line 208 of file gui_backdrop.cpp.

◆ get_tile_size()

float lxgui::gui::backdrop::get_tile_size ( ) const

Returns this backdrop's tile size.

Returns
This backdrop's tile size

Definition at line 106 of file gui_backdrop.cpp.

◆ is_background_tilling()

bool lxgui::gui::backdrop::is_background_tilling ( ) const

Checks if tilling is enabled for the background texture.

Returns
'true' if tilling is enabled for the background texture

Definition at line 94 of file gui_backdrop.cpp.

◆ notify_borders_updated()

void lxgui::gui::backdrop::notify_borders_updated ( ) const

Tells this backdrop that its parent frame has changed dimensions.

Definition at line 260 of file gui_backdrop.cpp.

◆ operator=() [1/2]

backdrop& lxgui::gui::backdrop::operator= ( backdrop &&  )
delete

Non-movable.

◆ operator=() [2/2]

backdrop& lxgui::gui::backdrop::operator= ( const backdrop )
delete

Non-copiable.

◆ render()

void lxgui::gui::backdrop::render ( ) const

Renders this backdrop on the current render target.

Definition at line 220 of file gui_backdrop.cpp.

◆ set_background()

void lxgui::gui::backdrop::set_background ( const std::string &  background_file)

Sets the background texture.

Parameters
background_fileThe background texture

Definition at line 34 of file gui_backdrop.cpp.

◆ set_background_color()

void lxgui::gui::backdrop::set_background_color ( const color c)

Sets the background color.

Parameters
cThe background color
Note
This color can be used to tint the background texture if any or simply render a plain color background.

Definition at line 69 of file gui_backdrop.cpp.

◆ set_background_insets()

void lxgui::gui::backdrop::set_background_insets ( const bounds2f insets)

Sets insets for the background texture.

Parameters
insetsThe insets array

Definition at line 110 of file gui_backdrop.cpp.

◆ set_background_tilling()

void lxgui::gui::backdrop::set_background_tilling ( bool  is_tilling)

Enables tilling for the background texture.

Parameters
is_tilling'true' to enable tilling

Definition at line 86 of file gui_backdrop.cpp.

◆ set_edge()

void lxgui::gui::backdrop::set_edge ( const std::string &  edge_file)

Sets the edge/corner texture.

Parameters
edge_fileThe edge/corner texture
Note
This texture's width must be 8 times greater than its height. The texture data is interpreted as:
  • [ 0, 1/8]: left edge
  • [1/8, 1/4]: right edge
  • [1/4, 3/8]: top edge (rotated 90 degrees ccw)
  • [3/8, 1/2]: bottom edge (rotated 90 degrees ccw)
  • [1/2, 5/8]: top-left corner
  • [5/8, 3/4]: top-right corner
  • [3/4, 7/8]: bottom-left corner
  • [7/8, 1]: bottom-right corner

Definition at line 134 of file gui_backdrop.cpp.

◆ set_edge_color()

void lxgui::gui::backdrop::set_edge_color ( const color c)

Sets the edge color.

Parameters
cThe edge color
Note
This color can be used to tint the edge texture if any or simply render a plain color edge.

Definition at line 181 of file gui_backdrop.cpp.

◆ set_edge_insets()

void lxgui::gui::backdrop::set_edge_insets ( const bounds2f insets)

Sets insets for the edge texture.

Parameters
insetsThe insets array

Definition at line 122 of file gui_backdrop.cpp.

◆ set_edge_size()

void lxgui::gui::backdrop::set_edge_size ( float  edge_size)

Sets the apparent edge size.

Parameters
edge_sizeThe new edge size
Note
Edges will be scaled by edge_size/edge_texture_height.

Definition at line 200 of file gui_backdrop.cpp.

◆ set_tile_size()

void lxgui::gui::backdrop::set_tile_size ( float  tile_size)

Sets the apparent tile size.

Parameters
tile_sizeThe new tile size
Note
Tile will be scaled by tile_size/background_texture_size.

Definition at line 98 of file gui_backdrop.cpp.

◆ set_vertex_color()

void lxgui::gui::backdrop::set_vertex_color ( const color c)

Sets the color to be multiplied to all drawn vertices.

Parameters
cThe new vertex color

Definition at line 212 of file gui_backdrop.cpp.


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