Thx
Works!
But with checking the position it's not as it should be.
I check the Position, so only the top left corner of the sprite.
Even though the sprite is in sight it isn't displayed because the position of the sprite is outside the view.
I tried something like this to get rid of this problem:
bool IsInSight(const sf::Drawable &Drawable, sf::View &View)
{
int X = Drawable.GetPosition().x;
int Y = Drawable.GetPosition().y;
int Width = Drawable.GetScale().x;
int Height = Drawable.GetScale().y;
sf::FloatRect Rect(X, Y, X+Width, Y+Height);
sf::FloatRect ViewRect = View.GetRect();
//check if the sprite is in the view
if(ViewRect.Intersects(Rect))
window.Draw(Drawable);
}
But it's just the same :-/ Suggestions?
Finn