protected override void Update(GameTime gameTime) { base.Update(gameTime); KeyboardUtils.Begin(); if (KeyboardUtils.IsPressed(Keys.Space)) { _drawBackground = !_drawBackground; } if (KeyboardUtils.IsPressed(Keys.Tab)) { var i = 0; for (; i < _fontSystems.Length; ++i) { if (_currentFontSystem == _fontSystems[i]) { break; } } ++i; if (i >= _fontSystems.Length) { i = 0; } _currentFontSystem = _fontSystems[i]; } if (KeyboardUtils.IsPressed(Keys.Enter)) { _currentFontSystem.UseKernings = !_currentFontSystem.UseKernings; } KeyboardUtils.End(); }
public static IEnumerable <Texture2D> EnumerateTextures(this FontSystem fontSystem) { return(new TextureEnumerator(fontSystem)); }
private static FontSystem InternalCreate(GraphicsDevice graphicsDevice, int textureWidth, int textureHeight, int blurAmount, int strokeAmount, bool premultiplyAlpha) { var result = new FontSystem(StbTrueTypeSharpFontLoader.Instance, graphicsDevice, textureWidth, textureHeight, blurAmount, strokeAmount, premultiplyAlpha); return(result); }
public TextureEnumerator(FontSystem font) { _font = font; }