Esempio n. 1
0
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);
}
Esempio n. 2
0
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);
}
Esempio n. 3
0
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);

}
Esempio n. 4
0
Paddle::Paddle(Type type, const TextureHolder& textures)
	: mType(type)
	, mSprite(textures.get(toTextureID(type)))
	, sticky(0)
{
}
Esempio n. 5
0
Aircraft::Aircraft(Type type, const TextureHolder& textures)
: mType(type)
, mSprite(textures.get(toTextureID(type)))
{
	centerOrigin(mSprite);
}