Caseus Tower
 All Classes Namespaces Files Functions Variables
SpriteHandler Class Reference

Creates an SpriteHandler object Creates an SpriteHandler object to deal with all of the applications sprites. More...

#include <spriteHandler.h>

Public Member Functions

 SpriteHandler (SDL_Renderer *)
 
 ~SpriteHandler ()
 
void loadGameSprites ()
 
void loadMenuSprites ()
 
void loadCreditsSprites ()
 
void loadLoseSprites ()
 
void deleteGameSprites ()
 
void deleteMenuSprites ()
 
void deleteCreditsSprites ()
 
void deleteLoseSprites ()
 
void loadSymbols ()
 
void drawGameSprite (std::string, int, float, float, int, int)
 
void drawMenuSprite (std::string, int, float, float, int, int)
 
void drawCreditsSprite (std::string, int, float, float, int, int)
 
void drawLoseSprite (std::string, int, float, float, int, int)
 

Private Attributes

SDL_Renderer * renderer
 
TexturebackgroundImage
 
TextureplatformSafe
 
std::vector< Texture * > platformDanger
 
std::vector< Texture * > playerSprite
 
std::vector< Texture * > symbols
 
std::vector< Texture * > pauseButton
 
std::vector< Texture * > playButton
 
std::vector< Texture * > creditsButton
 
std::vector< Texture * > exitButton
 
Texturecredits
 
float scale
 

Detailed Description

Creates an SpriteHandler object Creates an SpriteHandler object to deal with all of the applications sprites.

Definition at line 12 of file spriteHandler.h.

Constructor & Destructor Documentation

SpriteHandler::SpriteHandler ( SDL_Renderer *  )

Constructs a SpriteHandler object

Parameters
SDL_Renderer*a pointer to the renderer.
SpriteHandler::~SpriteHandler ( )

Destructs the SpriteHandler object

Member Function Documentation

void SpriteHandler::deleteCreditsSprites ( )

Deletes the Credits Sprite objects Deletes the Sprite objects used in the Credits.

void SpriteHandler::deleteGameSprites ( )

Deletes the Game Sprite objects Deletes the Sprite objects used in the Game.

void SpriteHandler::deleteLoseSprites ( )

Deletes the Lose Sprite objects Deletes the Sprite objects used in the Lose State.

void SpriteHandler::deleteMenuSprites ( )

Deletes the Menu Sprite objects Deletes the Sprite objects used in the Menu.

void SpriteHandler::drawCreditsSprite ( std::string  ,
int  ,
float  ,
float  ,
int  ,
int   
)

Draw the Credits Sprite to the screen Draws the Credits Sprite to the screen using the input variables.

Parameters
std::Stringthe type of Sprite
intthe index of the Sprite
floatthe x position of the Sprite
floatthe y position of the Sprite
intthe width of the Sprite
intthe height of the Sprite
void SpriteHandler::drawGameSprite ( std::string  ,
int  ,
float  ,
float  ,
int  ,
int   
)

Draw the Game Sprite to the screen Draws the Game Sprite to the screen using the input variables.

Parameters
std::Stringthe type of Sprite
intthe index of the Sprite
floatthe x position of the Sprite
floatthe y position of the Sprite
intthe width of the Sprite
intthe height of the Sprite
void SpriteHandler::drawLoseSprite ( std::string  ,
int  ,
float  ,
float  ,
int  ,
int   
)

Draw the Lose Sprite to the screen Draws the Lose Sprite to the screen using the input variables.

Parameters
std::Stringthe type of Sprite
intthe index of the Sprite
floatthe x position of the Sprite
floatthe y position of the Sprite
intthe width of the Sprite
intthe height of the Sprite
void SpriteHandler::drawMenuSprite ( std::string  ,
int  ,
float  ,
float  ,
int  ,
int   
)

Draw the Menu Sprite to the screen Draws the Menu Sprite to the screen using the input variables.

Parameters
std::Stringthe type of Sprite
intthe index of the Sprite
floatthe x position of the Sprite
floatthe y position of the Sprite
intthe width of the Sprite
intthe height of the Sprite
void SpriteHandler::loadCreditsSprites ( )

Loads the Credits Sprite objects Loads the Sprite objects to be used in the Credits.

void SpriteHandler::loadGameSprites ( )

Loads the Game Sprite objects Loads the Sprite objects to be used in the Game.

void SpriteHandler::loadLoseSprites ( )

Loads the Lose Sprite objects Loads the Sprite objects to be used in the Lose State.

void SpriteHandler::loadMenuSprites ( )

Loads the Menu Sprite objects Loads the Sprite objects to be used in the Menu.

void SpriteHandler::loadSymbols ( )

Load the symbols for Sprite objects Load the symbols for Sprite objects for use with displaying the score.

Member Data Documentation

Texture* SpriteHandler::backgroundImage
private

The background image

Definition at line 18 of file spriteHandler.h.

Texture* SpriteHandler::credits
private

The credit sprites.

Definition at line 36 of file spriteHandler.h.

std::vector<Texture*> SpriteHandler::creditsButton
private

Definition at line 31 of file spriteHandler.h.

std::vector<Texture*> SpriteHandler::exitButton
private

Definition at line 32 of file spriteHandler.h.

std::vector<Texture*> SpriteHandler::pauseButton
private

Definition at line 26 of file spriteHandler.h.

std::vector<Texture*> SpriteHandler::platformDanger
private

Definition at line 23 of file spriteHandler.h.

Texture* SpriteHandler::platformSafe
private

The game sprites (vectors of sprites mean they can be animated).

Definition at line 22 of file spriteHandler.h.

std::vector<Texture*> SpriteHandler::playButton
private

The menu sprites (vectors of sprites mean they can be animated).

Definition at line 30 of file spriteHandler.h.

std::vector<Texture*> SpriteHandler::playerSprite
private

Definition at line 24 of file spriteHandler.h.

SDL_Renderer* SpriteHandler::renderer
private

a pointer to the renderer

Definition at line 16 of file spriteHandler.h.

float SpriteHandler::scale
private

A scale value to help scale down numbers to the SDL screen

Definition at line 40 of file spriteHandler.h.

std::vector<Texture*> SpriteHandler::symbols
private

Definition at line 25 of file spriteHandler.h.


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