Advertisement
Guest User

Untitled

a guest
Jun 17th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.17 KB | None | 0 0
  1. #include "Animation.h"
  2.  
  3. Animation::Animation()
  4. {
  5. }
  6.  
  7.  
  8. Animation::~Animation()
  9. {
  10. }
  11.  
  12.  
  13. void Animation::LoadContent(std::string text, std::string &path, float posX, float posY, SDL_Renderer *renderer)
  14. {
  15.     this->preText = text;
  16.     this->posX = posX;
  17.     this->posY = posY;
  18.     this->pathImage = path;
  19.  
  20.     active = false;
  21.     alpha = 1.0f;
  22.     textColor = { 0xff, 0xff ,0xff };
  23.     int Size = 0;
  24.  
  25.     this->sprite.loadFromFile(path, renderer);
  26.     this->text.LoadText(text, textColor, renderer);
  27. }
  28.  
  29. void Animation::UnloadContent()
  30. {
  31.     this->text.free();
  32.     this->sprite.free();
  33.     this->preText = "";
  34.     this->posX = 0;
  35.     this->posY = 0;
  36. }
  37. void Animation::Update(SDL_Renderer *renderer)
  38. {
  39. }
  40.  
  41. void Animation::Draw(SDL_Renderer *renderer)
  42. {
  43.     text.render(posX, posY, renderer);
  44.     sprite.render(posX, posY, renderer);
  45. }
  46. float &Animation::getAlpha()
  47. {
  48.     return alpha;
  49. }
  50.  
  51. bool &Animation::getActive()
  52. {
  53.     return active;
  54. }
  55.  
  56. float &Animation::getScale()
  57. {
  58.     return scale;
  59. }
  60.  
  61. void Animation::setAlpha(float value)
  62. {
  63.     alpha = value;
  64. }
  65.  
  66. int &Animation::getPositionX()
  67. {
  68.     return posX;
  69. }
  70.  
  71. int &Animation::getPositionY()
  72. {
  73.     return posY;
  74. }
  75.  
  76. Text &Animation::getText()
  77. {
  78.     return text;
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement