Mana
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CompoundSprite Class Reference

#include <compoundsprite.h>

Public Member Functions

 CompoundSprite ()=default
 
 ~CompoundSprite ()
 
bool reset ()
 
bool play (const std::string &action)
 
bool update (int time)
 
bool draw (Graphics *graphics, int posX, int posY) const
 
int getWidth () const
 Gets the width in pixels of the first sprite in the list.
 
int getHeight () const
 Gets the height in pixels of the first sprite in the list.
 
float getAlpha () const
 
void setAlpha (float alpha)
 
bool setDirection (SpriteDirection direction)
 
int getNumberOfLayers () const
 
int getMaxDuration () const
 
size_t size () const
 
void add (Sprite *sprite)
 
void set (int layer, Sprite *sprite)
 
void clear ()
 
void ensureSize (size_t layerCount)
 
void doRedraw () const
 

Private Member Functions

void redraw () const
 

Private Attributes

ImagemImage = nullptr
 
ImagemAlphaImage = nullptr
 
int mWidth = 0
 
int mHeight = 0
 
int mOffsetX = 0
 
int mOffsetY = 0
 
bool mNeedsRedraw = false
 
float mAlpha = 1.0f
 
std::vector< Sprite * > mSprites
 

Detailed Description

Definition at line 27 of file compoundsprite.h.

Constructor & Destructor Documentation

◆ CompoundSprite()

CompoundSprite::CompoundSprite ( )
default

◆ ~CompoundSprite()

CompoundSprite::~CompoundSprite ( )

Definition at line 32 of file compoundsprite.cpp.

Member Function Documentation

◆ add()

void CompoundSprite::add ( Sprite sprite)

Definition at line 128 of file compoundsprite.cpp.

◆ clear()

void CompoundSprite::clear ( )

Definition at line 145 of file compoundsprite.cpp.

◆ doRedraw()

void CompoundSprite::doRedraw ( ) const
inline

Definition at line 81 of file compoundsprite.h.

◆ draw()

bool CompoundSprite::draw ( Graphics graphics,
int  posX,
int  posY 
) const

Definition at line 75 of file compoundsprite.cpp.

◆ ensureSize()

void CompoundSprite::ensureSize ( size_t  layerCount)

Definition at line 156 of file compoundsprite.cpp.

◆ getAlpha()

float CompoundSprite::getAlpha ( ) const
inline

Definition at line 48 of file compoundsprite.h.

◆ getHeight()

int CompoundSprite::getHeight ( ) const
inline

Gets the height in pixels of the first sprite in the list.

Definition at line 46 of file compoundsprite.h.

◆ getMaxDuration()

int CompoundSprite::getMaxDuration ( ) const

Definition at line 165 of file compoundsprite.cpp.

◆ getNumberOfLayers()

int CompoundSprite::getNumberOfLayers ( ) const

Definition at line 120 of file compoundsprite.cpp.

◆ getWidth()

int CompoundSprite::getWidth ( ) const
inline

Gets the width in pixels of the first sprite in the list.

Definition at line 41 of file compoundsprite.h.

◆ play()

bool CompoundSprite::play ( const std::string &  action)

Definition at line 51 of file compoundsprite.cpp.

◆ redraw()

void CompoundSprite::redraw ( ) const
private

Definition at line 193 of file compoundsprite.cpp.

◆ reset()

bool CompoundSprite::reset ( )

Definition at line 39 of file compoundsprite.cpp.

◆ set()

void CompoundSprite::set ( int  layer,
Sprite sprite 
)

Definition at line 134 of file compoundsprite.cpp.

◆ setAlpha()

void CompoundSprite::setAlpha ( float  alpha)
inline

Definition at line 49 of file compoundsprite.h.

◆ setDirection()

bool CompoundSprite::setDirection ( SpriteDirection  direction)

Definition at line 108 of file compoundsprite.cpp.

◆ size()

size_t CompoundSprite::size ( ) const
inline

Definition at line 57 of file compoundsprite.h.

◆ update()

bool CompoundSprite::update ( int  time)

Definition at line 63 of file compoundsprite.cpp.

Member Data Documentation

◆ mAlpha

float CompoundSprite::mAlpha = 1.0f
private

Definition at line 77 of file compoundsprite.h.

◆ mAlphaImage

Image* CompoundSprite::mAlphaImage = nullptr
mutableprivate

Definition at line 70 of file compoundsprite.h.

◆ mHeight

int CompoundSprite::mHeight = 0
private

Definition at line 72 of file compoundsprite.h.

◆ mImage

Image* CompoundSprite::mImage = nullptr
mutableprivate

Definition at line 69 of file compoundsprite.h.

◆ mNeedsRedraw

bool CompoundSprite::mNeedsRedraw = false
mutableprivate

Definition at line 75 of file compoundsprite.h.

◆ mOffsetX

int CompoundSprite::mOffsetX = 0
mutableprivate

Definition at line 73 of file compoundsprite.h.

◆ mOffsetY

int CompoundSprite::mOffsetY = 0
private

Definition at line 73 of file compoundsprite.h.

◆ mSprites

std::vector<Sprite*> CompoundSprite::mSprites
private

Definition at line 78 of file compoundsprite.h.

◆ mWidth

int CompoundSprite::mWidth = 0
mutableprivate

Definition at line 72 of file compoundsprite.h.


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