示例#1
0
        public DrawableFontAtlas(FontAtlas atlas, bool smooth = true)
        {
            // Invalid font, no glyphs, etc.
            if (atlas == null)
            {
                return;
            }

            Atlas = atlas;

            GLThread.ExecuteGLThread(() =>
            {
                Texture = new Texture(Atlas.Size, ImageUtil.AToRgba(Atlas.Pixels))
                {
                    Smooth = smooth
                };
            });

            // Free memory.
            Atlas.Pixels = null;
        }
 public void DebugDump(string fileName)
 {
     byte[] bytes = ImageUtil.AToRgba(Pixels);
     bytes = PngFormat.Encode(bytes, (int)Size.X, (int)Size.Y);
     File.WriteAllBytes(fileName, bytes);
 }