Hi, guys.
I want a mouseover + click script. I did and its working well. But if my sprites moves like 5 float right then subrect has same value. So i have read here i have to calculate it new.
I did that like:
if (RightKeyDown)
{
Player1.Move(5,0);
Player1.SetSubRect( sf::IntRect(Player1.GetPosition().x, Player1.GetPosition().y, Player1.GetPosition().x+50, Player1.GetPosition().y+50));
}
Are there wrongs?
Because click is working perfectly, but it lost their white color texture.
Screenshots to know what i mean:
When i have clicked
After moving 5 floats right. You see red what i did. There should be white. And in the area of red (between white and red) my click and mouseover works.
EDIT: Btw no rlly white i know. Its more grey