$treeview $search $mathjax
Stratagus
2.2.7
$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 | Load () |
void | DrawIcon (const CPlayer &player, const PixelPos &pos) const |
Draw icon. | |
void | DrawUnitIcon (const ButtonStyle &style, unsigned flags, const PixelPos &pos, 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 () const |
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::Load | ( | ) |
Draw icon.
Draw icon at pos.
player | Player pointer used for icon colors | |
pos | display pixel position |
void CIcon::DrawUnitIcon | ( | const ButtonStyle & | style, | |
unsigned | flags, | |||
const PixelPos & | pos, | |||
const std::string & | text | |||
) | 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 |
const std::string& CIcon::GetIdent | ( | ) | const [inline] |
int CIcon::Frame |
Graphic data.