$treeview $search $mathjax
Stratagus
2.2.6
$projectbrief
|
$projectbrief
|
$searchbox |
_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include <icons.h>
icons.cpp - The icons. | |
CIcon (const std::string &ident) | |
Map of ident to icon. | |
~CIcon () | |
void | DrawIcon (const CPlayer &player, int x, int y) const |
Draw icon. | |
void | DrawUnitIcon (const CPlayer *player, ButtonStyle *style, unsigned flags, int x, int y, const std::string &text) const |
Draw icon of a unit. | |
static CIcon * | New (const std::string &ident) |
static CIcon * | Get (const std::string &ident) |
Public Member Functions | |
const std::string & | GetIdent () |
Public Attributes | |
CGraphic * | G |
int | Frame |
Graphic data. |
#include "icons.h"
This structure contains all informations 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
CIcon * CIcon::New | ( | const std::string & | ident | ) | [static] |
Create a new icon
ident | Icon identifier |
CIcon * CIcon::Get | ( | const std::string & | ident | ) | [static] |
Get an icon
ident | Icon identifier |
void CIcon::DrawIcon | ( | const CPlayer & | player, | |
int | x, | |||
int | y | |||
) | const |
Draw icon.
Draw icon on x,y.
player | Player pointer used for icon colors | |
x | X display pixel position | |
y | Y display pixel position |
void CIcon::DrawUnitIcon | ( | const CPlayer * | player, | |
ButtonStyle * | style, | |||
unsigned | flags, | |||
int | x, | |||
int | y, | |||
const std::string & | text | |||
) | const |
Draw icon of a unit.
Draw unit icon 'icon' with border on x,y
player | Player pointer used for icon colors | |
style | Button style | |
flags | State of icon (clicked, mouse over...) | |
x | X display pixel position | |
y | Y display pixel position | |
text | Optional text to display |
const std::string& CIcon::GetIdent | ( | ) | [inline] |
int CIcon::Frame |
Graphic data.