public SaveAtlasses ( string _Destination ) : void | ||
_Destination | string | |
return | void |
static void Main(string[] args) { Console.WriteLine("TexturePacker - Package rect/non pow 2 textures into square power of 2 atlas"); if (args.Length == 0) { DisplayInfo(); return; } List<string> prms = args.ToList(); string sourcePath = ""; string searchPattern = ""; string outName = ""; int textureSize = 1024; int border = 0; bool debug = false; for (int ip = 0; ip < prms.Count; ++ip) { prms[ip] = prms[ip].ToLowerInvariant(); switch (prms[ip]) { case "-sp": case "--sourcepath": if (!prms[ip + 1].StartsWith("-")) { sourcePath = prms[ip + 1]; ++ip; } break; case "-ft": case "--filetype": if (!prms[ip + 1].StartsWith("-")) { searchPattern = prms[ip + 1]; ++ip; } break; case "-o": case "--output": if (!prms[ip + 1].StartsWith("-")) { outName = prms[ip + 1]; ++ip; } break; case "-s": case "--size": if (!prms[ip + 1].StartsWith("-")) { textureSize = int.Parse(prms[ip + 1]); ++ip; } break; case "-b": case "--border": if (!prms[ip + 1].StartsWith("-")) { border = int.Parse(prms[ip + 1]); ++ip; } break; case "-d": case "--debug": debug = true; break; } } if (sourcePath == "" || searchPattern == "" || outName == "") { DisplayInfo(); return; } else { Console.WriteLine("Processing, please wait"); } Packer packer = new Packer(); packer.Process(sourcePath, searchPattern, textureSize, border, debug); packer.SaveAtlasses(outName); }
private static void Main(string[] args) { Console.WriteLine("TexturePacker - Package rect/non pow 2 textures into square power of 2 atlas"); if (args.Length == 0) { DisplayInfo(); return; } List <string> prms = args.ToList(); string sourcePath = ""; string searchPattern = ""; string outName = ""; int textureSize = 1024; int border = 0; bool debug = false; for (int ip = 0; ip < prms.Count; ++ip) { prms[ip] = prms[ip].ToLowerInvariant(); switch (prms[ip]) { case "-sp": case "--sourcepath": if (!prms[ip + 1].StartsWith("-")) { sourcePath = prms[ip + 1]; ++ip; } break; case "-ft": case "--filetype": if (!prms[ip + 1].StartsWith("-")) { searchPattern = prms[ip + 1]; ++ip; } break; case "-o": case "--output": if (!prms[ip + 1].StartsWith("-")) { outName = prms[ip + 1]; ++ip; } break; case "-s": case "--size": if (!prms[ip + 1].StartsWith("-")) { textureSize = int.Parse(prms[ip + 1]); ++ip; } break; case "-b": case "--border": if (!prms[ip + 1].StartsWith("-")) { border = int.Parse(prms[ip + 1]); ++ip; } break; case "-d": case "--debug": debug = true; break; } } if (sourcePath == "" || searchPattern == "" || outName == "") { DisplayInfo(); return; } else { Console.WriteLine("Processing, please wait"); } Packer packer = new Packer(); packer.Process(sourcePath, searchPattern, textureSize, border, debug); packer.SaveAtlasses(outName); packer.SerializeAtlasses(); }