Oh, thanks, wouldn't have guessed that.
By the way, the behavior for specifying the sub rectangle is a bit non-intuitive. When I type
sprite.SetSubRect(IntRect(
Intellisense tells me that the four parameters are:
LeftCoord, TopCoord, RightCoord, BottomCoord
So having a sprite in my spritesheet at [0-7], [0-7], I wrote:
sprite.SetSubRect(IntRect(0, 0, 7, 7));
But then it seemed I was missing a pixel right and one bottom. So I actually have to write this:
sprite.SetSubRect(IntRect(0, 0, 8, 8 ));
Which describes my sprite's sub rectangle as
[0-8[, [0-8[
A bit weird IMO. XNA was fool-proof:
public Rectangle (
int x,
int y,
int width,
int height
)