I'm using the full Spritebatch.Draw function to draw my explosion sprite since I also need rotation. I am using the Scale value to resize my texture, but I can't get it to be accurate.
I want to be able to set the textures Size to a specific pixel size, width/height are exactly the same. Say the texture is 128x128, and I want to resize it to be 23x23.
Heres my current code:
Vector2 Scale = new Vector2((float)sprite.Area.Width / (float)sprite.Texture.Width, (float)sprite.Area.Height / (float)sprite.Texture.Height); spriteBatch.Draw(sprite.Texture, sprite.Position, null, sprite.Color * sprite.Alpha, (float)Math.Atan2(sprite.Angle.Y, sprite.Angle.X), new Vector2(sprite.Area.Width / 2, sprite.Area.Height / 2), Scale, SpriteEffects.None, 0f);
I have the Area set to be the size I want it at, however the Draw function seems to not be drawing it to the exact size.