When using XNA Framework spriteBatch.Draw()
the sprite appears stretched despite having seemingly same scale on both axes. From what I can see the sprite should be located 64 units from the left and should be pressed against the top of the window, but should be a square, rather than a rectangle. The texture is a simple 8x8 square.
Code:
spriteBatch.Draw(Content.Load<Texture2D>("enemies/blob/blob_walk0"), new Rectangle(64, 0, 128, 64), Color.White);
Sorry if this question isn't up to standard, I'm new to stackoverflow and don't really know what I'm doing.
new Rectangle()
uses a method where you've to define the following in pixels: (x, y, width, height)
.
In your case, the width is 128 pixels, while the height is 64 pixels. So it's width will stretch twice as much.
Replacing the 128
with 64
makes the width equall to the height, and will result in a square.