The base of the GUI's appearence. More...
#include <gui_texture.hpp>
Public Types | |
enum | blend_mode { BLEND_NONE, BLEND_BLEND, BLEND_KEY, BLEND_ADD, BLEND_MOD } |
Public Member Functions | |
texture (manager *pManager) | |
Constructor. | |
virtual | ~texture () |
Destructor. | |
virtual std::string | serialize (const std::string &sTab) const |
Prints all relevant information about this widget in a string. | |
virtual void | render () |
Renders this widget on the current render target. | |
virtual void | copy_from (uiobject *pObj) |
Copies an uiobject's parameters into this texture (inheritance). | |
blend_mode | get_blend_mode () const |
Returns this texture's blending mode. | |
const color & | get_color () const |
Returns this texture's color. | |
const gradient & | get_gradient () const |
Returns this texture's gradient. | |
const std::array< float, 8 > & | get_tex_coord () const |
Returns this texture's texture coordinates. | |
bool | get_tex_coord_modifies_rect () const |
Checks if this texture's dimensions are affected by texture coordinates. | |
const std::string & | get_texture () const |
Returns this textures's texture file. | |
color | get_vertex_color () const |
Returns this textures's vertex color. | |
bool | is_desaturated () const |
Checks if this texture is desaturated. | |
void | set_blend_mode (blend_mode mBlendMode) |
Sets this texture's blending mode. | |
void | set_blend_mode (const std::string &sBlendMode) |
Sets this texture's blending mode. | |
void | set_desaturated (bool bIsDesaturated) |
Makes this texture appear without any color. | |
void | set_gradient (const gradient &mGradient) |
Adds a gradient effect to this texture. | |
void | set_tex_coord (const std::array< float, 4 > &lCoordinates) |
Sets this texture's texture coordinates. | |
void | set_tex_coord (const std::array< float, 8 > &lCoordinates) |
Sets this texture's texture coordinates. | |
void | set_tex_coord_modifies_rect (bool bTexCoordModifiesRect) |
Sets whether this texture's dimensions are affected by texture coordinates. | |
void | set_texture (const std::string &sFile) |
Sets this texture's texture file. | |
void | set_texture (utils::refptr< render_target > pRenderTarget) |
Reads texture data from a render_target. | |
void | set_color (const color &mColor) |
Sets this texture's color. | |
void | set_sprite (utils::refptr< sprite > pSprite) |
Directly sets this texture's underlying sprite. | |
void | set_vertex_color (const color &mColor) |
Sets this texture's vertex color. | |
virtual void | create_glue () |
Creates the associated Lua glue. | |
virtual void | parse_block (xml::block *pBlock) |
Parses data from an xml::block. | |
Static Public Member Functions | |
static void | register_glue (utils::wptr< lua::state > pLua) |
Registers this widget to the provided lua::state. |
The base of the GUI's appearence.
This object contains either a texture taken from a file, or a plain color.
Definition at line 15 of file gui_texture.hpp.
Definition at line 19 of file gui_texture.hpp.
gui::texture::texture | ( | manager * | pManager | ) | [explicit] |
Constructor.
Definition at line 14 of file gui_texture.cpp.
gui::texture::~texture | ( | ) | [virtual] |
Destructor.
Definition at line 23 of file gui_texture.cpp.
void gui::texture::copy_from | ( | uiobject * | pObj | ) | [virtual] |
Copies an uiobject's parameters into this texture (inheritance).
pObj | The uiobject to copy |
Definition at line 101 of file gui_texture.cpp.
void gui::texture::create_glue | ( | ) | [virtual] |
Creates the associated Lua glue.
Reimplemented from gui::layered_region.
Definition at line 92 of file gui_texture.cpp.
texture::blend_mode gui::texture::get_blend_mode | ( | ) | const |
Returns this texture's blending mode.
Definition at line 128 of file gui_texture.cpp.
const color & gui::texture::get_color | ( | ) | const |
Returns this texture's color.
Definition at line 133 of file gui_texture.cpp.
const gradient & gui::texture::get_gradient | ( | ) | const |
Returns this texture's gradient.
Definition at line 138 of file gui_texture.cpp.
const std::array< float, 8 > & gui::texture::get_tex_coord | ( | ) | const |
Returns this texture's texture coordinates.
Definition at line 143 of file gui_texture.cpp.
bool gui::texture::get_tex_coord_modifies_rect | ( | ) | const |
Checks if this texture's dimensions are affected by texture coordinates.
Definition at line 148 of file gui_texture.cpp.
const std::string & gui::texture::get_texture | ( | ) | const |
Returns this textures's texture file.
Definition at line 153 of file gui_texture.cpp.
color gui::texture::get_vertex_color | ( | ) | const |
bool gui::texture::is_desaturated | ( | ) | const |
Checks if this texture is desaturated.
Definition at line 171 of file gui_texture.cpp.
void gui::texture::parse_block | ( | xml::block * | pBlock | ) | [virtual] |
Parses data from an xml::block.
pBlock | The texture's xml::block |
Reimplemented from gui::layered_region.
Definition at line 9 of file gui_texture_parser.cpp.
void gui::texture::register_glue | ( | utils::wptr< lua::state > | pLua | ) | [static] |
Registers this widget to the provided lua::state.
Definition at line 9 of file gui_texture_glues.cpp.
void gui::texture::render | ( | ) | [virtual] |
Renders this widget on the current render target.
Reimplemented from gui::region.
Definition at line 81 of file gui_texture.cpp.
std::string gui::texture::serialize | ( | const std::string & | sTab | ) | const [virtual] |
Prints all relevant information about this widget in a string.
sTab | The offset to give to all lines |
Reimplemented from gui::layered_region.
Definition at line 27 of file gui_texture.cpp.
void gui::texture::set_blend_mode | ( | const std::string & | sBlendMode | ) |
Sets this texture's blending mode.
sBlendMode | The new blending mode |
Definition at line 185 of file gui_texture.cpp.
void gui::texture::set_blend_mode | ( | blend_mode | mBlendMode | ) |
Sets this texture's blending mode.
mBlendMode | The new blending mode |
Definition at line 176 of file gui_texture.cpp.
void gui::texture::set_color | ( | const color & | mColor | ) |
Sets this texture's color.
mColor | The color to use |
Definition at line 349 of file gui_texture.cpp.
void gui::texture::set_desaturated | ( | bool | bIsDesaturated | ) |
Makes this texture appear without any color.
bIsDesaturated | 'true' if you want to remove colors |
Definition at line 214 of file gui_texture.cpp.
void gui::texture::set_gradient | ( | const gradient & | mGradient | ) |
void gui::texture::set_sprite | ( | utils::refptr< sprite > | pSprite | ) |
Directly sets this texture's underlying sprite.
pSprite | The new sprite to use |
Definition at line 360 of file gui_texture.cpp.
void gui::texture::set_tex_coord | ( | const std::array< float, 8 > & | lCoordinates | ) |
Sets this texture's texture coordinates.
lCoordinates | This texture's texture coordinates |
Definition at line 275 of file gui_texture.cpp.
void gui::texture::set_tex_coord | ( | const std::array< float, 4 > & | lCoordinates | ) |
Sets this texture's texture coordinates.
lCoordinates | This texture's texture coordinates |
Definition at line 260 of file gui_texture.cpp.
void gui::texture::set_tex_coord_modifies_rect | ( | bool | bTexCoordModifiesRect | ) |
Sets whether this texture's dimensions are affected by texture coordinates.
bTexCoordModifiesRect | 'true' to make dimensions change with tex coords |
Definition at line 290 of file gui_texture.cpp.
void gui::texture::set_texture | ( | utils::refptr< render_target > | pRenderTarget | ) |
Reads texture data from a render_target.
pRenderTarget | The render_target from which to read the data |
Definition at line 327 of file gui_texture.cpp.
void gui::texture::set_texture | ( | const std::string & | sFile | ) |
Sets this texture's texture file.
sFile | The file from which to read data |
Definition at line 299 of file gui_texture.cpp.
void gui::texture::set_vertex_color | ( | const color & | mColor | ) |