示例#1
0
 public GameFontSystem(IServiceRegistry registry)
     : base(registry)
 {
     Visible = true;
     FontSystem = new FontSystem();
     Services.AddService(typeof(FontSystem), FontSystem);
     Services.AddService(typeof(IFontFactory), FontSystem);
 }
        public FontCacheManager(FontSystem system, int textureDefaultSize = 1024)
        {
            this.system = system;
            Textures = cacheTextures;

            // create the cache textures
            var newTexture = Texture.New2D(system.GraphicsDevice, textureDefaultSize, textureDefaultSize, PixelFormat.R8_UNorm);
            cacheTextures.Add(newTexture);
            newTexture.Reload = ReloadCache;
            ClearCache();
        }