Hellow everyone !
I have some problems with sfml
the thing is that i am checking if mouse is over the sprite and everything seems fine(first time a made this)
bool isMouseOverObjectBox(sf::Sprite &object, sf::Texture &tex, sf::RenderWindow &target){
sf::Vector2i Mpos(sf::Mouse::getPosition(target));
sf::Vector2f pos(object.getPosition());
sf::Vector2u size(tex.getSize());
if(Mpos.y >= pos.y && Mpos.x >= pos.x && Mpos.y <= pos.y+size.y && Mpos.x <= pos.x+size.x){
return true;
}
return false;
}
but this isn't all i want. i want to make it work with rotated, scaled sprite and unfortinatly i don't know how to do it can anyone help me?