____                _       __
    / __ )____  _____   | |     / /___ ___________
   / __  / __ \/ ___/   | | /| / / __ `/ ___/ ___/
  / /_/ / /_/ (__  )    | |/ |/ / /_/ / /  (__  )
 /_____/\____/____/     |__/|__/\__,_/_/  /____/

       A futuristic real-time strategy game.
          This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project. Distributed under the "GNU General Public License"

CIcon Class Reference

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

#include <icons.h>

List of all members.

Public Member Functions

 CIcon (const std::string &ident)
 ~CIcon ()
void DrawIcon (const CPlayer *player, int x, int y) const
 Draw icon of a unit.
void DrawUnitIcon (const CPlayer *player, ButtonStyle *style, unsigned flags, int x, int y, const std::string &text) const
const std::string & GetIdent ()

Static Public Member Functions

static CIconNew (const std::string &ident)
static CIconGet (const std::string &ident)
 Draw icon.

Public Attributes

CGraphicG
 Graphic data.
int Frame
 Frame number in graphic.


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.

Definition at line 104 of file icons.h.


Constructor & Destructor Documentation

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

CIcon constructor

Definition at line 67 of file icons.cpp.

Referenced by New().

CIcon::~CIcon (  ) 

CIcon destructor

Definition at line 74 of file icons.cpp.

References CGraphic::Free(), and G.


Member Function Documentation

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

Create a new icon

Parameters:
ident Icon identifier
Returns:
New icon

Definition at line 86 of file icons.cpp.

References AllIcons, CIcon(), and Icons.

Referenced by tolua_stratagus_CIcon_New00().

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

Draw icon.

Get an icon

Parameters:
ident Icon identifier
Returns:
The icon

Definition at line 106 of file icons.cpp.

References _C_, DebugPrint, and Icons.

Referenced by IconConfig::Load(), and tolua_stratagus_CIcon_Get00().

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

Draw icon of a unit.

Draw icon on x,y.

Parameters:
player Player pointer used for icon colors
x X display pixel position
y Y display pixel position

Definition at line 177 of file icons.cpp.

References CGraphic::DrawFrameClip(), CPlayerColorGraphic::DrawPlayerColorFrameClip(), Frame, G, and CPlayer::Index.

Referenced by DrawPieMenu(), and DrawUnitIcons().

void CIcon::DrawUnitIcon ( const CPlayer player,
ButtonStyle style,
unsigned  flags,
int  x,
int  y,
const std::string &  text 
) const

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

Definition at line 197 of file icons.cpp.

References CButtonPanel::AutoCastBorderColorRGB, ButtonStyleProperties::BorderColor, ButtonStyleProperties::BorderColorRGB, CUserInterface::ButtonPanel, ButtonStyle::Clicked, ButtonStyle::Default, DrawMenuButton(), Frame, ButtonStyleProperties::Frame, G, ButtonStyle::Hover, IconAutoCast, IconSelected, ButtonStyleProperties::Sprite, and UI.

Referenced by CButtonPanel::Draw(), DrawEditorPanel(), DrawInfoPanelMultipleSelected(), and DrawUnitInfo().

const std::string& CIcon::GetIdent (  )  [inline]

Definition at line 118 of file icons.h.

Referenced by LoadIcons().


Member Data Documentation

Frame number in graphic.

Definition at line 121 of file icons.h.

Referenced by DrawIcon(), DrawUnitIcon(), and LoadIcons().


The documentation for this class was generated from the following files:

Generated on Sat Feb 21 00:28:23 2009 for Bos Wars by  doxygen 1.5.6