# How to do smooth sprite movement on WP7 XNA

What's the correct technique for getting smooth sprite translations with XNA?

I've been developing the WP7 version of an app for a startup, so when we heard Angry Birds got ported today we wanted to check it out and compare. Angry Birds on WP7 had the sub-pixel blur problem with the bird sprites, whereas iPhone, Android, and Chrome all had smooth movement.

It sounds like they are accidentally rounding their sprite positions to the nearest pixel. This can happen automatically if you use the SpriteBatch.Draw() call that takes a Rectangle as the position of the sprite, since XNA's Rectangle uses integers instead of floats to represent position.

If sprites are drawn with integer coords, then sub-pixel rendering will not occur, and sprites will appear to snap from one pixel position to the next, instead of blending smoothly between them.

• That explains why, would the assumption for a fix then be to use the overload that accepts a Point()?
– Nate
Jun 30 '11 at 5:06
• You mean a Vector2, and yes. And to make sure that the floating point coordinates in the Vector2 struct are not being rounded to an integer value! Jun 30 '11 at 6:11
• Snapping to the nearest pixel can however make for a clearer image, for example when using SpriteFonts, however this I only tested on Windows. Jun 30 '11 at 8:17
• It's difficult to tell exactly whether the blur is occurring because of the sub-pixel rendering or because of the perceived blur from snapping to pixels. Which one actually results in the clearer image, at least in the context of little sprites on a cell phone screen flying around with Box2D physics? Jun 30 '11 at 14:00
• Haha, yes. Can you tell I was working in a different .NET stack, where its Point instead of Vector2?
– Nate
Jun 30 '11 at 14:51

It could have to do with the framerate or it could have to do with the fact that xna does sub pixel rendering