Added scale to my draw and now it says im missing position or rectangle?

Before i added scale to the mix it drew my sprite animation just fine, but now i wanna scale it down it says that my position and/or rectangle is missing which makes no sense to me at all. Here is some screens of the issue and the position + rectangle it claims to be missing are highlighted with red. Any tips would be greatly appreciated^^

The position is not missing, but you specified a position AND a destination rectangle for your sprite. You can’t do both! If you give a rectangle spritebatch will scale your texture to fit the rectangle (it will ignore the scale parameter).
I’m guessing sAnimations contains the source rectangles for all your frames and you put in the parameters in the wrong order :stuck_out_tongue: In that case you should change the draw call to

spriteBatch.Draw(sTexture, sPostion + sOffsets[currentAnimation], null, sAnimations[currentAnimation][frameIndex], null, 0f, sScale);

so you use the rectangle as the source rectangle and position and scale are used for the destination.
Note that you can drop the final parameter since White is default for the color.

1 Like

It worked! :smiley: thanks alot man! And for the nice explanation it all makes sense now ^^

You’re welcome :blush: