Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/CGUISprite.h
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | struct SGUIImage | ||||
NONCOPYABLE(SGUIImage); | NONCOPYABLE(SGUIImage); | ||||
public: | public: | ||||
SGUIImage() : | SGUIImage() : | ||||
m_FixedHAspectRatio(0.f), | m_FixedHAspectRatio(0.f), | ||||
m_RoundCoordinates(true), | m_RoundCoordinates(true), | ||||
m_WrapMode(GL_REPEAT), | m_WrapMode(GL_REPEAT), | ||||
m_Effects(), | m_Effects(), | ||||
m_Border(false), | m_Border(false), | ||||
m_DeltaZ(0.f), | |||||
m_Size(CGUISize::Full()), | m_Size(CGUISize::Full()), | ||||
m_TextureSize(CGUISize::Full()) | m_TextureSize(CGUISize::Full()) | ||||
{ | { | ||||
} | } | ||||
// Filename of the texture | // Filename of the texture | ||||
VfsPath m_TextureName; | VfsPath m_TextureName; | ||||
Show All 29 Lines | public: | ||||
std::shared_ptr<SGUIImageEffects> m_Effects; | std::shared_ptr<SGUIImageEffects> m_Effects; | ||||
// Color | // Color | ||||
CGUIColor m_BackColor; | CGUIColor m_BackColor; | ||||
CGUIColor m_BorderColor; | CGUIColor m_BorderColor; | ||||
// 0 or 1 pixel border is the only option | // 0 or 1 pixel border is the only option | ||||
bool m_Border; | bool m_Border; | ||||
/** | |||||
* Z value modification of the image. | |||||
* Inputted in XML as x-level, although it just an easier and safer | |||||
* way of declaring delta-z. | |||||
*/ | |||||
float m_DeltaZ; | |||||
}; | }; | ||||
/** | /** | ||||
* The GUI sprite, is actually several real sprites (images) | * The GUI sprite, is actually several real sprites (images) | ||||
* like a collage. View the section \<sprites\> in the GUI | * like a collage. View the section \<sprites\> in the GUI | ||||
* TDD for more information. | * TDD for more information. | ||||
* | * | ||||
* Drawing routine is located in CGUI | * Drawing routine is located in CGUI | ||||
Show All 25 Lines | |||||
{ | { | ||||
public: | public: | ||||
NONCOPYABLE(CGUISpriteInstance); | NONCOPYABLE(CGUISpriteInstance); | ||||
MOVABLE(CGUISpriteInstance); | MOVABLE(CGUISpriteInstance); | ||||
CGUISpriteInstance(); | CGUISpriteInstance(); | ||||
CGUISpriteInstance(const CStr& SpriteName); | CGUISpriteInstance(const CStr& SpriteName); | ||||
void Draw(CGUI& pGUI, const CRect& Size, std::map<CStr, const CGUISprite*>& Sprites, float Z) const; | void Draw(CGUI& pGUI, const CRect& Size, std::map<CStr, const CGUISprite*>& Sprites) const; | ||||
/** | /** | ||||
* Whether this Sprite has no texture name set. | * Whether this Sprite has no texture name set. | ||||
*/ | */ | ||||
operator bool() const { return !m_SpriteName.empty(); }; | operator bool() const { return !m_SpriteName.empty(); }; | ||||
/** | /** | ||||
* Returns the sprite texture name. | * Returns the sprite texture name. | ||||
Show All 20 Lines |
Wildfire Games · Phabricator