Ejemplo n.º 1
0
        private void DrawText(string text, Font font, Vector2 offset, Color color)
        {
            Point p = GraphicsDevice.Viewport.Bounds.Center;
            Vector2 measure = titleFont.MeasureString(text);

            float x = p.X - measure.X / 2;
            float y = p.Y - measure.Y / 2;
            Vector2 position = new Vector2(x, y);

            font.Write(text, position + offset, spriteBatch, color);
        }
Ejemplo n.º 2
0
 public DiagnosticGame()
 {
     messages = new Dictionary<string, string>();
     font = new Font("Fonts/Diagnostics");
 }
Ejemplo n.º 3
0
 public PausableGame()
 {
     titleFont = new Font("Fonts/Title");
     regularFont = new Font("Fonts/Regular");
 }