gui::backdrop Class Reference

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

#include <gui_backdrop.hpp>

List of all members.

Public Types

enum  edge_type {
  EDGE_LEFT, EDGE_RIGHT, EDGE_TOP, EDGE_BOTTOM,
  EDGE_TOPLEFT, EDGE_TOPRIGHT, EDGE_BOTTOMLEFT, EDGE_BOTTOMRIGHT
}

Public Member Functions

 backdrop (frame *pParent)
 Constructor.
void copy_from (const backdrop &mbackdrop)
 Copies a backdrop's parameters into this one (inheritance).
void set_background (const std::string &sBackgroundFile)
 Sets the background texture.
const std::string & get_background_file () const
 Returns this backdrop's background file.
void set_background_color (const color &mColor)
 Sets the background color.
color get_background_color () const
 Returns the background color.
void set_backgrond_tilling (bool bBackgroundTilling)
 Enables tilling for the background texture.
bool is_background_tilling () const
 Checks if tilling is enabled for the background texture.
void set_tile_size (uint uiTileSize)
 Sets the appearent tile size.
uint get_tile_size () const
 Returns this backdrop's tile size.
void set_background_insets (const std::array< int, 4 > &lInsets)
 Sets insets for the background texture.
void set_background_insets (int iLeft, int iRight, int iTop, int iBottom)
 Sets insets for the background texture.
const std::array< int, 4 > & get_background_insets () const
 Returns this backdrop's background insets.
void set_edge_insets (const std::array< int, 4 > &lInsets)
 Sets insets for the edge texture.
void set_edge_insets (int iLeft, int iRight, int iTop, int iBottom)
 Sets insets for the edge texture.
const std::array< int, 4 > & get_edge_insets () const
 Returns this backdrop's edge insets.
void set_edge (const std::string &sEdgeFile)
 Sets the edge/corner texture.
const std::string & get_edge_file () const
 Returns this backdrop's edge file.
void set_edge_color (const color &mColor)
 Sets the edge color.
color get_edge_color () const
 Returns the edge color.
void set_edge_size (uint uiEdgeSize)
 Sets the appearent edge size.
uint get_edge_size () const
 Returns this backdrop's edge size.
void set_vertex_color (const color &mColor)
 Sets the color to be multiplied to all drawn vertices.
void render () const
 Renders this backdrop on the current render target.

Detailed Description

Draws borders and background of a frame.

Definition at line 12 of file gui_backdrop.hpp.


Member Enumeration Documentation

Enumerator:
EDGE_LEFT 
EDGE_RIGHT 
EDGE_TOP 
EDGE_BOTTOM 
EDGE_TOPLEFT 
EDGE_TOPRIGHT 
EDGE_BOTTOMLEFT 
EDGE_BOTTOMRIGHT 

Definition at line 16 of file gui_backdrop.hpp.


Constructor & Destructor Documentation

gui::backdrop::backdrop ( frame pParent  )  [explicit]

Constructor.

Parameters:
pParent The frame it is linked to

Definition at line 11 of file gui_backdrop.cpp.


Member Function Documentation

void gui::backdrop::copy_from ( const backdrop mbackdrop  ) 

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

Parameters:
mbackdrop The backdrop to copy

Definition at line 19 of file gui_backdrop.cpp.

color gui::backdrop::get_background_color (  )  const

Returns the background color.

Returns:
The background color

Definition at line 85 of file gui_backdrop.cpp.

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

Returns this backdrop's background file.

Returns:
This backdrop's background file

Definition at line 69 of file gui_backdrop.cpp.

const std::array< int, 4 > & gui::backdrop::get_background_insets (  )  const

Returns this backdrop's background insets.

Returns:
This backdrop's background insets

Definition at line 123 of file gui_backdrop.cpp.

color gui::backdrop::get_edge_color (  )  const

Returns the edge color.

Returns:
The edge color

Definition at line 234 of file gui_backdrop.cpp.

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

Returns this backdrop's edge file.

Returns:
This backdrop's edge file

Definition at line 206 of file gui_backdrop.cpp.

const std::array< int, 4 > & gui::backdrop::get_edge_insets (  )  const

Returns this backdrop's edge insets.

Returns:
This backdrop's edge insets

Definition at line 138 of file gui_backdrop.cpp.

uint gui::backdrop::get_edge_size (  )  const

Returns this backdrop's edge size.

Returns:
This backdrop's edge size

Definition at line 244 of file gui_backdrop.cpp.

uint gui::backdrop::get_tile_size (  )  const

Returns this backdrop's tile size.

Returns:
This backdrop's tile size

Definition at line 108 of file gui_backdrop.cpp.

bool 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 98 of file gui_backdrop.cpp.

void gui::backdrop::render (  )  const

Renders this backdrop on the current render target.

Definition at line 261 of file gui_backdrop.cpp.

void gui::backdrop::set_backgrond_tilling ( bool  bBackgroundTilling  ) 

Enables tilling for the background texture.

Parameters:
bBackgroundTilling 'true' to enable tilling

Definition at line 90 of file gui_backdrop.cpp.

void gui::backdrop::set_background ( const std::string &  sBackgroundFile  ) 

Sets the background texture.

Parameters:
sBackgroundFile The background texture

Definition at line 39 of file gui_backdrop.cpp.

void gui::backdrop::set_background_color ( const color mColor  ) 

Sets the background color.

Parameters:
mColor The 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 74 of file gui_backdrop.cpp.

void gui::backdrop::set_background_insets ( int  iLeft,
int  iRight,
int  iTop,
int  iBottom 
)

Sets insets for the background texture.

Parameters:
iLeft The left inset
iRight The right inset
iTop The top inset
iBottom The bottom inset

Definition at line 118 of file gui_backdrop.cpp.

void gui::backdrop::set_background_insets ( const std::array< int, 4 > &  lInsets  ) 

Sets insets for the background texture.

Parameters:
lInsets The insets array
Note:
Insets are interpreted as (left, right, top, bottom).

Definition at line 113 of file gui_backdrop.cpp.

void gui::backdrop::set_edge ( const std::string &  sEdgeFile  ) 

Sets the edge/corner texture.

Parameters:
sEdgeFile The edge/corner texture
Note:
This texture's width must be 8 times greater than its height.

texture parts are 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 143 of file gui_backdrop.cpp.

void gui::backdrop::set_edge_color ( const color mColor  ) 

Sets the edge color.

Parameters:
mColor The 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 211 of file gui_backdrop.cpp.

void gui::backdrop::set_edge_insets ( int  iLeft,
int  iRight,
int  iTop,
int  iBottom 
)

Sets insets for the edge texture.

Parameters:
iLeft The left inset
iRight The right inset
iTop The top inset
iBottom The bottom inset

Definition at line 133 of file gui_backdrop.cpp.

void gui::backdrop::set_edge_insets ( const std::array< int, 4 > &  lInsets  ) 

Sets insets for the edge texture.

Parameters:
lInsets The insets array
Note:
Insets are interpreted as (left, right, top, bottom).

Definition at line 128 of file gui_backdrop.cpp.

void gui::backdrop::set_edge_size ( uint  uiEdgeSize  ) 

Sets the appearent edge size.

Parameters:
uiEdgeSize The new edget size
Note:
Edges will be scaled by uiEdgeSize/edgeTextureHeight.

Definition at line 239 of file gui_backdrop.cpp.

void gui::backdrop::set_tile_size ( uint  uiTileSize  ) 

Sets the appearent tile size.

Parameters:
uiTileSize The new edget size
Note:
Tile will be scaled by uiTileSize/backgroundTextureSize.

Definition at line 103 of file gui_backdrop.cpp.

void gui::backdrop::set_vertex_color ( const color mColor  ) 

Sets the color to be multiplied to all drawn vertices.

Parameters:
mColor The new vertex color

Definition at line 249 of file gui_backdrop.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Tue Jan 1 21:58:12 2013 for gui by  doxygen 1.6.1