Beispiel #1
0
        internal Palette(byte id, string name, string directory)
        {
            Id        = id;
            Name      = name;
            Directory = directory;

            Images = LoadTilesForPalette(directory);
            Images.DeterminePlacementOnPalette(32, 32, 5);
            Image = Images.CombineImagesIntoOne(32, 32, 5);
        }
Beispiel #2
0
        private PaletteImageList LoadTilesForPalette(string paletteDirectory)
        {
            string[] files = System.IO.Directory.GetFiles(paletteDirectory, "*.png");

            var images = new PaletteImageList();

            byte tileId = 0;

            foreach (string file in files)
            {
                var    bitmap = new Bitmap(file);
                string name   = Path.GetFileName(file);
                images.Add(new PaletteImage(tileId, name, paletteDirectory, bitmap));
                tileId++;
            }

            return(images);
        }