book and page now use the new camera system; added functionality to camera; progress on mainscreen;

This commit is contained in:
2018-11-12 00:33:40 -06:00
parent a2defc5d11
commit 0f10ce3a07
5 changed files with 62 additions and 16 deletions

View File

@@ -31,5 +31,12 @@ namespace RhythmBullet.Zer01HD.Utilities.Camera
Matrix.CreateScale(Zoom) *
Matrix.CreateTranslation(new Vector3(bounds.Width * 0.5f, bounds.Height * 0.5f, 0f));
}
public void LinearInterpolationToPosition(float alpha, Vector2 targetPosition)
{
if (alpha < 0 && alpha > 1f) throw new ArgumentException("Alpha can't be greater than 1f, or less than 0.");
Position.X = MathHelper.Lerp(Position.X, targetPosition.X, alpha);
Position.Y = MathHelper.Lerp(Position.Y, targetPosition.Y, alpha);
}
}
}