From Cream Stork, 1 Week ago, written in Plain Text.
This paste will kick the bucket in 10 Months.
Embed
  1. #pragma once
  2.  
  3. #include <SFML/Graphics.hpp>
  4. #include <string>
  5. #include "../Component.hpp"
  6.  
  7. class GraphicsComponent : public Component {
  8.     private:
  9.         sf::Texture* texRef = nullptr;
  10.         sf::IntRect rect = sf::IntRect(0,0,0,0);
  11.         sf::Vector2f scale = sf::Vector2f(0.1f, 0.1f);
  12.         sf::Sprite sprite;
  13.     public:
  14.         void setTextureRef(sf::Texture* texRef) {
  15.             this->texRef = texRef;
  16.         }
  17.         sf::Texture* getTextureRef() {
  18.             return this->texRef;
  19.         }
  20.         void setRect(sf::IntRect rect) {
  21.             this->rect = rect;
  22.         }
  23.         sf::IntRect getRect() {
  24.             return this->rect;
  25.         }
  26.         void setScale(sf::Vector2f scale) {
  27.             this->scale = scale;
  28.         }
  29.         sf::Vector2f getScale() {
  30.             return this->scale;
  31.         }
  32.         sf::Sprite* getSprite() {
  33.             return &this->sprite;
  34.         }
  35.         void setSprite(sf::Sprite* sprite) {
  36.             this->sprite = *sprite;
  37.         }
  38. };