I am making a game on a WP7 device using C# and XNA. I have a system where I always want the object the user is touching to be brought to the top, so every time it is touched I add
float.Epsilon to its draw depth (I have it set so that 0 is the back and 1 is the front).
On the Emulator that all works fine, but when I run it on my device the draw depths seem to be completely random.
I am hoping that anybody knows a way to fix this. I have tried doing a Clean & Rebuild and uninstalling from the device but that is no luck. My call to
and to draw I use
spriteBatch.Draw(Texture, new Rectangle((int)X, (int)Y, (int)Width, (int)Height), null, Color.White, 0, Vector2.Zero, SpriteEffects.None, mDrawDepth);
mDrawDepth is a float value of the draw depth (likely to be a very small number; a small multiple of
Any help much appreciated, thanks!