ZValues on Sprite.Draw()
However, if i change my zvalue in game, say on a button press, then the sprite disapears completely.
I've debugged the code, and checked the zvalue of the affected sprites after the position change, and it's the correct value.
Here's the setup.
Draw code for sprite. (Assume sprTexture, scrrect, center, position, color are all at working values)
sSprite.Begin(SpriteFlags.AlphaBlend) sSprite.Draw(sprTexture, ScrRect, Center, Position, Color) sSprite.End() |
I'm changing the position variable this way.
Position.X += X_value Position.Y += Y_value Position.Z += Z_value |
Now to move the sprite left , you add -1 to the position, move up add -1 to y, move in and out add 0.1 or -0.1 depending on the way your going.
All the values check out, but the sprite just disapears. I can debug.print all the other variables used to draw, and they all check out too.
Any ideas?

