$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

CIcon Class Reference

Icon: rectangle image used in menus. More...

#include <icons.h>

List of all members.


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 CIconNew (const std::string &ident)
static CIconGet (const std::string &ident)

Public Member Functions

const std::string & GetIdent ()

Public Attributes

CGraphicG
int Frame
 Graphic data.

Detailed Description

Icon: rectangle image used in menus.

#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.

CIcon::G

Graphic image containing the loaded graphics. Loaded by LoadIcons(). All icons belonging to the same icon file shares this structure.

CIcon::Frame

Frame number in the graphic to display.


Constructor & Destructor Documentation

CIcon::CIcon ( const std::string &  ident  ) 

Map of ident to icon.

CIcon constructor

CIcon::~CIcon (  ) 

CIcon destructor


Member Function Documentation

CIcon * CIcon::New ( const std::string &  ident  )  [static]

Create a new icon

Parameters:
ident Icon identifier
Returns:
New icon

CIcon * CIcon::Get ( const std::string &  ident  )  [static]

Get an icon

Parameters:
ident Icon identifier
Returns:
The icon

void CIcon::DrawIcon ( const CPlayer player,
int  x,
int  y 
) const

Draw icon.

Draw icon on x,y.

Parameters:
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

Parameters:
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]


Member Data Documentation

Graphic data.


The documentation for this class was generated from the following files:
(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.