Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Animation.h"
- Animation::Animation()
- {
- }
- Animation::~Animation()
- {
- }
- void Animation::LoadContent(std::string text, std::string &path, float posX, float posY, SDL_Renderer *renderer)
- {
- this->preText = text;
- this->posX = posX;
- this->posY = posY;
- this->pathImage = path;
- active = false;
- alpha = 1.0f;
- textColor = { 0xff, 0xff ,0xff };
- int Size = 0;
- this->sprite.loadFromFile(path, renderer);
- this->text.LoadText(text, textColor, renderer);
- }
- void Animation::UnloadContent()
- {
- this->text.free();
- this->sprite.free();
- this->preText = "";
- this->posX = 0;
- this->posY = 0;
- }
- void Animation::Update(SDL_Renderer *renderer)
- {
- }
- void Animation::Draw(SDL_Renderer *renderer)
- {
- text.render(posX, posY, renderer);
- sprite.render(posX, posY, renderer);
- }
- float &Animation::getAlpha()
- {
- return alpha;
- }
- bool &Animation::getActive()
- {
- return active;
- }
- float &Animation::getScale()
- {
- return scale;
- }
- void Animation::setAlpha(float value)
- {
- alpha = value;
- }
- int &Animation::getPositionX()
- {
- return posX;
- }
- int &Animation::getPositionY()
- {
- return posY;
- }
- Text &Animation::getText()
- {
- return text;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement