示例#1
0
        public static TextureAtlas Create(params FreeType.Glyph[] glyphs)
        {
            var builder = new TextureAtlasBuilder();

            foreach (var glyph in glyphs)
            {
                builder.AddImage(new ImageHandle(glyph));
            }

            return(builder.Create());
        }
示例#2
0
        public static TextureAtlas Create(Dictionary <uint, Bitmap> images)
        {
            var builder = new TextureAtlasBuilder();

            foreach (var image in images)
            {
                builder.AddImage(new ImageHandle(image.Key, image.Value));
            }

            return(builder.Create());
        }
示例#3
0
        private void LoadTextures()
        {
            Console.WriteLine("[Client] Loading textures...");

            using (var builder = new TextureAtlasBuilder <GLTexture>(textureFactory))
            {
                var files = Directory.GetFiles("./Textures/Blocks");
                foreach (var file in files)
                {
                    var name = Path.GetFileNameWithoutExtension(file);
                    builder.AddImage(name, new Bitmap(file));
                }

                blockTextureAtlas = builder.Build();
            }

            Console.WriteLine("[Client] Loaded textures");
        }