Person::Person(Type type, const TextureHolder& textures) : mType(type) , mSprite(textures.get(toTextureID(type))) { sf::FloatRect bounds = mSprite.getLocalBounds(); mSprite.setOrigin(bounds.width / 2.f, bounds.height / 2.f); }
Aircraft::Aircraft(Type type, const TextureHolder& textures) : m_Type(type) , m_Sprite(textures.get(toTextureID(type))) { sf::FloatRect bounds = m_Sprite.getLocalBounds(); m_Sprite.setOrigin(bounds.width / 2.f, bounds.height / 2.f); }
Aircraft::Aircraft(Type type, const TextureHolder& textures) : mType(type) , mSprite(textures.get(toTextureID(type))) { if (type == Textures::Eagle) { mSprite.setScale(0.2f, 0.2f); } // Align the origin for this object sf::FloatRect bounds = mSprite.getLocalBounds(); mSprite.setOrigin(bounds.width / 2.f, bounds.height / 2.f); }
Paddle::Paddle(Type type, const TextureHolder& textures) : mType(type) , mSprite(textures.get(toTextureID(type))) , sticky(0) { }
Aircraft::Aircraft(Type type, const TextureHolder& textures) : mType(type) , mSprite(textures.get(toTextureID(type))) { centerOrigin(mSprite); }