After many battles with IntRect i successfully initialized it like this:
player.cpp
Player::Player(VideoMode VMo){
playerRectSourceSprite.left = 0;
playerRectSourceSprite.top = 0;
playerRectSourceSprite.width = 60;
playerRectSourceSprite.height = 60;
}
Why i couldn't do this like this:
playerRectSourceSprite(0, 0, 60, 60);
or like this
IntRect playerRectSourceSprite(0, 0, 60, 60); // I know this one is definitely wrong but i tried this as well
Of course i could initialize it this way:
playerRectSourceSprite = {0, 0, 60, 60}; // but then i receive warnings and i read this isn't best way of initializing
but in the same moment i can initialize Sprite position in the same constructor in a way i can't IntRect:
playerS.setPosition(50, 450);
Is there any reason behind it, or maybe there is different way to initialize IntRect collectively? Or, maybe, i am doing something incorrectly?