____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
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"
#include <icons.h>
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 CIcon * | New (const std::string &ident) |
| static CIcon * | Get (const std::string &ident) |
| Draw icon. | |
Public Attributes | |
| CGraphic * | G |
| Graphic data. | |
| int | Frame |
| Frame number in graphic. | |
#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.
Definition at line 104 of file icons.h.
| CIcon::CIcon | ( | const std::string & | ident | ) |
| CIcon::~CIcon | ( | ) |
| CIcon * CIcon::New | ( | const std::string & | ident | ) | [static] |
| CIcon * CIcon::Get | ( | const std::string & | ident | ) | [static] |
Draw icon.
Get an icon
| ident | Icon identifier |
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.
| 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
| 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] |
Graphic data.
Definition at line 120 of file icons.h.
Referenced by CalculateMaxIconSize(), DrawIcon(), DrawUnitIcon(), DrawUnitIcons(), LoadIcons(), UiDrawLifeBar(), UiDrawManaBar(), and ~CIcon().
| int CIcon::Frame |
Frame number in graphic.
Definition at line 121 of file icons.h.
Referenced by DrawIcon(), DrawUnitIcon(), and LoadIcons().
1.5.6