I'm using the sprite's Width and Height parameters to resize sprites to specific pixel-specific sizes. I just got the SFML v1.6 release today and I had a question about what seems to be a behavioral difference from v1.5.
In v1.6, a sprite's position seems to be shifting as the sprite is resized. The larger the sprite is resized, the more the sprite's position is shifted.
Using the code below, here are pictures of the difference I'm seeing between v1.5 and v.6:
In v1.5, I can draw my resized sprite at a given location:
But when I try the same thing in v.16, the resized sprite is shifted right:
The length of the "gap" seems to be determined by how large I resize the red rectangle.
//draw little green dot at 500,300
DrawGreenDot(new Vector(500, 300));
//draw the red box
DrawBox(new Vector2(500, 300), new Vector2(400, 60));
......
void DrawBox(Vector2 position, Vector2 sizeVector)
{
Sprite s = new Sprite(Assets.sheet0);
s.SubRect = new IntRect(1,1,8,8);
s.Color = new Color(255,0,0,128);
s.Position = position;
s.Width = sizeVector.X;
s.Height = sizeVector.Y;
Assets.screenManager.App.Draw(s);
}
Am I perhaps using the Width and Height parameters incorrectly?
(I am using the .Net build)[/img]