Example #1
0
        public void DrawScore(SpriteBatch b, Vector2 drawPos, double score)
        {
            var scoreStr = ScoreRenderer.StringFor(score);

            for (int i = 0; i < scoreStr.Length; i++)
            {
                // Only attempt to draw character if supported.
                if (fontGraphics.ContainsKey(scoreStr[i]))
                {
                    Vector2 offset = drawPos + new Vector2(ScoreRenderer.OffsetOf(scoreStr, i), 1);
                    b.Draw(fontGraphics[scoreStr[i]], offset, Color.White);
                }
            }
        }