Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. class CEntity : public sf::RectangleShape
  2. {
  3. public:
  4.     // If the user does not want to create it directly but needs a reference, for example
  5.     CEntity() {}
  6.  
  7.     // Overloaded constructor for ease of use
  8.     CEntity(sf::Texture* texturename)
  9.     {
  10.         create(texturename); // Not included in the constructor because create will be needed for empty constructor users
  11.     }
  12.  
  13.     create(sf::Texture* texturename)
  14.     {
  15.         setSize(sf::Vector2f(textureName->getSize().x, textureName->getSize().y));
  16.         setTexture(texturename);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement