Hello,
i have a problem with camera scrolling…
Sometimes not always there some kind of bumps/jumps happening.
Very tiny and sometimes more often sometimes less often.
Difficult to explain…(my english is not the best)
There is more code , but this is the important part , i guess
In Draw:
spriteBatch.Begin(SpriteSortMode.FrontToBack, null, SamplerState.LinearClamp, null, null, null, Utilities.Camera.Instance.TransformMatrix);
//basically two rendertargets that represents the tilemap
scene.Draw(spriteBatch);
spriteBatch.End();
public Matrix TransformMatrix
{
get
{
return
Matrix.CreateTranslation(new Vector3(-Location.X, -Location.Y, 0.0f)) *
Matrix.CreateRotationZ(Rotation) *
Matrix.CreateScale(ZoomHori*2.0f, ZoomVert*2.0f, 1.0f);
}
}
And in Update:
//camera location
Location.X += 0.1f * (float)gameTime.ElapsedGameTime.TotalMilliseconds;
framerate could be… i have framedrops sometimes… 58-60 but that should not happen, with my hardware…
The bumps appear when frames are dropping…
I have no clue…
Any suggestions are welcome…