void initPack(){ JButton packButton = Style.createMenuButton("Pack"); packButton.setIcon(Icon.icon("epackage")); packButton.addActionListener(new ActionListener(){ @Override public void actionPerformed(ActionEvent arg0) { Settings settings = new Settings(); settings.maxWidth = 2048; settings.maxHeight = 2048; settings.paddingX = 0; settings.paddingY = 0; TexturePacker2.process(settings, Content.getProject()+File.separator+"pack", Content.getProject()+"atlas/", "pack.atlas"); for(File f: new File(Content.getProject()+File.separator+"pack").listFiles()){ if(f.isDirectory()){ TexturePacker2.process(settings, f.getPath(), Content.getProject()+"atlas/", f.getName()); JOptionPane.showMessageDialog(null, "Packed Texture: "+f.getName(), "Texture Packer", JOptionPane.INFORMATION_MESSAGE); } } } }); add(packButton); }
private static void createAtlasWidgets() { Settings settings = new Settings(); settings.minHeight = 512; settings.minWidth = 512; settings.maxHeight = 512; settings.maxWidth = 512; settings.paddingY = 2; settings.paddingX = 2; settings.wrapY = TextureWrap.Repeat; TexturePacker2.process(settings, //"D:\\gamepictures\\widgets\\", "D:\\gamepictures\\widgets\\redjavolak", "D:/MySelf/Android/Workspace/HgRepo/GoingUnder/assets/atlases", "widgets"); }
private static void createAtlas() { Settings settings = new Settings(); settings.minHeight = 512; settings.minWidth = 512; settings.maxHeight = 512; settings.maxWidth = 512; settings.paddingY = 2; settings.paddingX = 2; settings.wrapY = TextureWrap.Repeat; TexturePacker2.process(settings, "D:\\gamepictures\\2\\", "D:/MySelf/Android/Workspace/HgRepo/GoingUnder/assets/atlases", "game"); }
public TexturePackerFileProcessor (Settings defaultSettings, String packFileName) { this.defaultSettings = defaultSettings; if (packFileName.indexOf('.') == -1) packFileName += ".atlas"; this.packFileName = packFileName; setFlattenOutput(true); addInputSuffix(".png", ".jpg"); }
/** @param rootDir Can be null. */ public ImageProcessor (File rootDir, Settings settings) { this.settings = settings; if (rootDir != null) { rootPath = rootDir.getAbsolutePath().replace('\\', '/'); if (!rootPath.endsWith("/")) rootPath += "/"; } }
public static void main(String[] args) { Settings settings = new Settings(); settings.filterMin = TextureFilter.Linear; settings.filterMag = TextureFilter.Linear; TexturePacker2.process(settings, "../dev-images", "../Droha-android/assets/data", "empaquetado"); System.out.println("Empaquetado Completo!"); }
public MaxRectsPacker (Settings settings) { this.settings = settings; if (settings.minWidth > settings.maxWidth) throw new RuntimeException("Page min width cannot be higher than max width."); if (settings.minHeight > settings.maxHeight) throw new RuntimeException("Page min height cannot be higher than max height."); }
public TexturePackerFileProcessor () { this(new Settings(), "pack.atlas"); }
public ImageProcessor (Settings settings) { this(null, settings); }
public ImageProcessor (File rootDir, Settings settings) { this.settings = settings; rootPath = rootDir.getAbsolutePath().replace('\\', '/'); if (!rootPath.endsWith("/")) rootPath += "/"; }