Example #1
0
        public static void FinishSheets()
        {
            if (Settings.DeveloperMode)
            {
                for (int i = 0; i < Sheets.Length; i++)
                {
                    var sheet = Sheets[i];
                    if (sheet == null)
                    {
                        break;
                    }

                    BitmapSaver.Save($"{FileExplorer.Logs}spritesheet_{i}.png", TextureManager.GetContent(sheet.TextureID, sheet.Size, sheet.Size), sheet.Bounds);
                }
            }

            SheetBuilder.Clear();

            sheetsLoaded = true;
        }
Example #2
0
        public void Save_ShouldThrow_WhenIncorrectPath()
        {
            Action act = () => BitmapSaver.Save(new Bitmap(100, 100), "png", "blablapath");

            act.Should().Throw <ArgumentException>();
        }
Example #3
0
        public void Save_ShouldThrow_WhenIncorrectFormat()
        {
            Action act = () => BitmapSaver.Save(new Bitmap(100, 100), "jpga");

            act.Should().Throw <ArgumentException>();
        }
Example #4
0
 public void Save_ShouldThrow_WhenIncorrectPath()
 {
     BitmapSaver.Save(new Bitmap(100, 100), "png", "blablapath").IsSuccess.Should().BeFalse();
 }
Example #5
0
 public void Save_ShouldThrow_WhenIncorrectFormat()
 {
     BitmapSaver.Save(new Bitmap(100, 100), "jpga").IsSuccess.Should().BeFalse();
 }