public FPSTestState(TextureManager textureManager)
 {
     _textureManager = textureManager;
     _font = new Font(textureManager.Get("font"),
         FontParser.Parse("font.fnt"));
     _fpsText = new Text("FPS:", _font);
 }
Example #2
0
        public void DrawText(Text text)
        {
            foreach (CharacterSprite c in text.CharacterSprites)
            {
                DrawSprite(c.Sprite);
            }

        }
        public void Render()
        {
            Gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT);
            _fpsText = new Text("FPS: " + _fps.CurrentFPS.ToString("00.0"), _font);
            _renderer.DrawText(_fpsText);

            // Rendering 10,000 quads is much faster with the batch method.
            for (int i = 0; i < 1000; i++)
            {
               _renderer.DrawText(_fpsText);
            }
            _renderer.Render(); // new for batch method

        }
 public SpecialEffectState(TextureManager manager)
 {
     _font = new Font(manager.Get("font"), FontParser.Parse("font.fnt"));
     _text = new Text("Hello", _font);
 }
 public CharacterBounceState(TextureManager manager)
 {
     _font = new Font(manager.Get("font"), FontParser.Parse("font.fnt"));
     _text = new Text("Hello", _font);
 }
 public SpecialEffectState(TextureManager manager)
 {
     _font = new Font(manager.Get("font"), FontParser.Parse("font.fnt"));
     _text = new Text("Hello", _font);
 }