Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CGUISpriteInstance Class Reference

#include <CGUISprite.h>

Collaboration diagram for CGUISpriteInstance:

Public Member Functions

 NONCOPYABLE (CGUISpriteInstance)
 
 MOVABLE (CGUISpriteInstance)
 
 CGUISpriteInstance ()
 
 CGUISpriteInstance (const CStr &SpriteName)
 
 CGUISpriteInstance (const CStr &SpriteName, const bool RoundCoordinates)
 
void Draw (CGUI &pGUI, CCanvas2D &canvas, const CRect &Size, std::map< CStr, std::unique_ptr< const CGUISprite > > &Sprites) const
 
 operator bool () const
 Whether this Sprite has no texture name set. More...
 
const CStr & GetName () const
 Returns the sprite texture name. More...
 
void SetName (const CStr &SpriteName)
 Changes the texture name. More...
 
void SetRoundCoordinates (const bool RoundCoordinates)
 Sets the coordinates to be rounded to integer pixels. More...
 

Private Attributes

CStr m_SpriteName {}
 
bool m_RoundCoordinates {true}
 
GUIRenderer::DrawCalls m_DrawCallCache
 
CRect m_CachedSize
 

Constructor & Destructor Documentation

◆ CGUISpriteInstance() [1/3]

CGUISpriteInstance::CGUISpriteInstance ( )

◆ CGUISpriteInstance() [2/3]

CGUISpriteInstance::CGUISpriteInstance ( const CStr &  SpriteName)

◆ CGUISpriteInstance() [3/3]

CGUISpriteInstance::CGUISpriteInstance ( const CStr &  SpriteName,
const bool  RoundCoordinates 
)

Member Function Documentation

◆ Draw()

void CGUISpriteInstance::Draw ( CGUI &  pGUI,
CCanvas2D &  canvas,
const CRect &  Size,
std::map< CStr, std::unique_ptr< const CGUISprite > > &  Sprites 
) const

◆ GetName()

const CStr & CGUISpriteInstance::GetName ( ) const
inline

Returns the sprite texture name.

◆ MOVABLE()

CGUISpriteInstance::MOVABLE ( CGUISpriteInstance  )

◆ NONCOPYABLE()

CGUISpriteInstance::NONCOPYABLE ( CGUISpriteInstance  )

◆ operator bool()

CGUISpriteInstance::operator bool ( ) const
inline

Whether this Sprite has no texture name set.

◆ SetName()

void CGUISpriteInstance::SetName ( const CStr &  SpriteName)

Changes the texture name.

Use as rarely as possible, because it clears the draw cache.

◆ SetRoundCoordinates()

void CGUISpriteInstance::SetRoundCoordinates ( const bool  RoundCoordinates)

Sets the coordinates to be rounded to integer pixels.

This is useful for pixel art, icons in text, to avoid blurry filtering. Use as rarely as possible, because it clears the draw cache.

Member Data Documentation

◆ m_CachedSize

CRect CGUISpriteInstance::m_CachedSize
mutableprivate

◆ m_DrawCallCache

GUIRenderer::DrawCalls CGUISpriteInstance::m_DrawCallCache
mutableprivate

◆ m_RoundCoordinates

bool CGUISpriteInstance::m_RoundCoordinates {true}
private

◆ m_SpriteName

CStr CGUISpriteInstance::m_SpriteName {}
private

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