MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / copyFromSprite

Method copyFromSprite

extlibs/sfe/src/ComplexSprite.cpp:34–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 10

setColorMethod · 0.95
getScaleMethod · 0.80
getColorMethod · 0.80
getTextureMethod · 0.45
getLocalBoundsMethod · 0.45
setPositionMethod · 0.45
getPositionMethod · 0.45
setRotationMethod · 0.45
getRotationMethod · 0.45
setScaleMethod · 0.45

Tested by

no test coverage detected