| 32 | } |
| 33 | |
| 34 | void ComplexSprite::copyFromSprite(const sf::Sprite& sprite) |
| 35 | { |
| 36 | m_texture = sprite.getTexture(); |
| 37 | m_textureRect = sprite.getTextureRect(); |
| 38 | sf::FloatRect bounds = sprite.getLocalBounds(); |
| 39 | m_vertices[0].position = sf::Vector2f(0, 0); |
| 40 | m_vertices[1].position = sf::Vector2f(0, bounds.height); |
| 41 | m_vertices[2].position = sf::Vector2f(bounds.width, 0); |
| 42 | m_vertices[3].position = sf::Vector2f(bounds.width, bounds.height); |
| 43 | this->setPosition(sprite.getPosition()); |
| 44 | this->setRotation(sprite.getRotation()); |
| 45 | this->setScale(sprite.getScale()); |
| 46 | this->setColor(sprite.getColor()); |
| 47 | updateTexCoords(); |
| 48 | } |
| 49 | |
| 50 | void ComplexSprite::setTexture(const sf::Texture& texture, bool resetRect) |
| 51 | { |
nothing calls this directly
no test coverage detected