hi!
sprite.setOrigin(sf::Vector2f(sprite.getTexture()->getSize().x * 0.05, sprite.getTexture()->getSize().y * 0.05));
i dont understand this part can anyone explain this operator (->) and sprite.getTexture()->getSize().x ?
hi!
sprite.setOrigin(sf::Vector2f(sprite.getTexture()->getSize().x * 0.05, sprite.getTexture()->getSize().y * 0.05));
i dont understand this part can anyone explain this operator (->) and sprite.getTexture()->getSize().x ?
class X {
public:
X() { x = 4; }
int x;
};
X *p = new X();
p->x = 5; // Assign 5 to the 'x' variable in the *p instance.
"p->x" is equivalent to "(*p).x".Why are you extracting the texture when you could use sf::Sprite::getLocalBounds?
Why are you extracting the texture when you could use sf::Sprite::getLocalBounds?
i am learning sfml and thats what tutorial teaches , if there is a easier way i would like to learn
can anyone explain ?
bool intersects(const sf::RectangleShape & rect1, const sf::RectangleShape & rect2){