_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
Icon: rectangle image used in menus. More...
#include <icons.h>
Public Member Functions | |
const std::string & | GetIdent () const |
Public Attributes | |
CPlayerColorGraphic * | G |
CPlayerColorGraphic * | GScale |
Graphic data. More... | |
int | Frame |
Icon when drawn grayscaled. More... | |
icons.cpp - The icons. | |
CIcon (const std::string &ident) | |
Map of ident to icon. More... | |
~CIcon () | |
void | Load () |
void | DrawIcon (const PixelPos &pos, const int player=-1) const |
Draw icon. More... | |
void | DrawGrayscaleIcon (const PixelPos &pos, const int player=-1) const |
Draw grayscale icon. More... | |
void | DrawCooldownSpellIcon (const PixelPos &pos, const int percent) const |
Draw cooldown spell. More... | |
void | DrawUnitIcon (const ButtonStyle &style, unsigned flags, const PixelPos &pos, const std::string &text, const int playerIndex=-1) const |
Draw icon of a unit. More... | |
void | DrawSingleSelectionIcon (const ButtonStyle &style, unsigned flags, const PixelPos &pos, const std::string &text, const CUnit &unit) const |
void | DrawGroupSelectionIcon (const ButtonStyle &style, unsigned flags, const PixelPos &pos, const std::string &text, const CUnit &unit) const |
void | DrawContainedIcon (const ButtonStyle &style, unsigned flags, const PixelPos &pos, const std::string &text, const CUnit &unit) const |
void | ClearExtraGraphics () |
Modify the extra icon graphics. More... | |
void | AddSingleSelectionGraphic (CPlayerColorGraphic *g) |
void | AddGroupSelectionGraphic (CPlayerColorGraphic *g) |
void | AddContainedGraphic (CPlayerColorGraphic *g) |
void | SetPaletteSwaps (std::vector< PaletteSwap > &newSwaps) |
static CIcon * | New (const std::string &ident) |
static CIcon * | Get (const std::string &ident) |
Icon: rectangle image used in menus.
#include "icons.h"
This structure contains all information about an icon.
The icon structure members:
CIcon::Ident
Unique identifier of the icon, used to reference it in config files and during startup. Don't use this in game, use instead the pointer to this structure.
Graphic image containing the loaded graphics. Loaded by LoadIcons(). All icons belonging to the same icon file shares this structure.
Frame number in the graphic to display.
CIcon::CIcon | ( | const std::string & | ident | ) |
Map of ident to icon.
CIcon constructor
CIcon::~CIcon | ( | ) |
CIcon destructor
void CIcon::AddContainedGraphic | ( | CPlayerColorGraphic * | g | ) |
void CIcon::AddGroupSelectionGraphic | ( | CPlayerColorGraphic * | g | ) |
void CIcon::AddSingleSelectionGraphic | ( | CPlayerColorGraphic * | g | ) |
void CIcon::ClearExtraGraphics | ( | ) |
Modify the extra icon graphics.
void CIcon::DrawContainedIcon | ( | const ButtonStyle & | style, |
unsigned | flags, | ||
const PixelPos & | pos, | ||
const std::string & | text, | ||
const CUnit & | unit | ||
) | const |
Draw cooldown spell.
Draw cooldown spell effect on icon at pos.
pos | display pixel position |
percent | cooldown percent |
Draw grayscale icon.
Draw grayscale icon at pos.
pos | display pixel position |
void CIcon::DrawGroupSelectionIcon | ( | const ButtonStyle & | style, |
unsigned | flags, | ||
const PixelPos & | pos, | ||
const std::string & | text, | ||
const CUnit & | unit | ||
) | const |
Draw icon.
Draw icon at pos.
player | Player pointer used for icon colors |
pos | display pixel position |
void CIcon::DrawSingleSelectionIcon | ( | const ButtonStyle & | style, |
unsigned | flags, | ||
const PixelPos & | pos, | ||
const std::string & | text, | ||
const CUnit & | unit | ||
) | const |
void CIcon::DrawUnitIcon | ( | const ButtonStyle & | style, |
unsigned | flags, | ||
const PixelPos & | pos, | ||
const std::string & | text, | ||
const int | playerIndex = -1 |
||
) | const |
Draw icon of a unit.
Draw unit icon 'icon' with border on x,y
style | Button style |
flags | State of icon (clicked, mouse over...) |
pos | display pixel position |
text | Optional text to display |
|
static |
Get an icon
ident | Icon identifier |
|
inline |
void CIcon::Load | ( | ) |
|
static |
Create a new icon
ident | Icon identifier |
void CIcon::SetPaletteSwaps | ( | std::vector< PaletteSwap > & | newSwaps | ) |
int CIcon::Frame |
Icon when drawn grayscaled.
CPlayerColorGraphic* CIcon::G |
CPlayerColorGraphic* CIcon::GScale |
Graphic data.