本文整理汇总了Java中com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings类的典型用法代码示例。如果您正苦于以下问题:Java Settings类的具体用法?Java Settings怎么用?Java Settings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Settings类属于com.badlogic.gdx.tools.texturepacker.TexturePacker包,在下文中一共展示了Settings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings; //导入依赖的package包/类
public static void main(String[] args) {
Settings settings = new Settings();
settings.maxWidth = 2048;
settings.maxHeight = 2048;
// We will assume that this code runs from
// [art]
// Raw assets live in
// [art]/assets/[sheetname]
// Thus, all asset source paths should be prefixed with
// assets
// and all asset destination paths should be prefixed with
// package
TexturePacker.process(settings, "assets/images", "package/assets", "main");
TexturePacker.process(settings, "assets/characters", "package/assets", "characters");
TexturePacker.process(settings, "assets/titleScreen", "package/assets", "titlescreen");
TexturePacker.process(settings, "assets/menuControls", "package/assets", "menu");
TexturePacker.process(settings, "assets/creditslogos", "package/assets", "credits");
}
示例2: main
import com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings; //导入依赖的package包/类
public static void main (String[] arg) throws IOException {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.width = 1280;
config.height = 720;
// Packer settings
Settings settings = new Settings();
settings.maxWidth = 2048;
settings.maxHeight = 2048;
settings.edgePadding = true;
settings.paddingX = 0;
settings.paddingY = 0;
// Pack textures
//RuntimeTexturePacker.generateAtlases(settings);
new LwjglApplication(new LibgdxJam(), config);
}
示例3: processFolder
import com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings; //导入依赖的package包/类
private static final void processFolder(Settings settings, String path)
{
File folderToProcess = new File(path);
boolean folderRequiresProcess = false;
for(File childFile : folderToProcess.listFiles())
{
if(childFile.isDirectory())
{
processFolder(settings, childFile.getAbsolutePath());
}
else
{
// It is a file, we need to pack!!
folderRequiresProcess = true;
}
}
// Perform actual pack now that we know that it's required
if(folderRequiresProcess)
{
TexturePacker.process(settings, path, path, folderToProcess.getName());
}
}
示例4: main
import com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings; //导入依赖的package包/类
public static void main(String[] arg) {
if (Assets.rebuildAtlas) {
Settings settings = new Settings();
settings.maxWidth = 2048;
settings.maxHeight = 2048;
settings.debug = Assets.drawDebugOutline;
try {
TexturePacker.process(settings, "assets-raw",
"../android/assets", "assets");
} catch (Exception e) {
e.printStackTrace();
}
}
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.width = 1280;
config.height = 720;
config.addIcon("icon128.png", FileType.Internal);
config.addIcon("icon32.png", FileType.Internal);
config.addIcon("icon16.png", FileType.Internal);
new LwjglApplication(new Main(), config);
}
示例5: main
import com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings; //导入依赖的package包/类
public static void main(String[] arg) throws FileNotFoundException, IOException {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.title = GameConstants.WINDOW_TITLE;
config.addIcon("gameicon.png", FileType.Internal);
config.width = GameConstants.GAME_WIDTH;
config.height = GameConstants.GAME_HEIGHT;
config.fullscreen = false;
readConfigFromPreference(config);
config.vSyncEnabled = config.fullscreen;
// check debug/run configuration ENVIRONMENT tab
// if the "DEVEOPMENT" flag is true, then the graphics will be packed together
// set the flag to false before exporting the jar
String getenv = System.getenv("DEVELOPMENT");
if (getenv != null && "true".equals(getenv)) {
Settings settings = new Settings();
settings.combineSubdirectories = true;
TexturePacker.process(settings, "../core/assets/graphics/hud", "../core/assets/packedGraphics", "hud");
TexturePacker.process(settings, "../core/assets/graphics/game", "../core/assets/packedGraphics", "gameGraphics");
TexturePacker.process(settings, "../core/assets/graphics/menu", "../core/assets/packedGraphics", "menuGraphics");
}
new LwjglApplication(new GDXGame(), config);
}
示例6: main
import com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings; //导入依赖的package包/类
public static void main(String args[]){
if(resolver == null){
resolver = new Main();
}
boolean hacer_packer = false;
if(hacer_packer){
Settings settings = new Settings();
settings.pot = false;
settings.maxHeight = 1024;
settings.maxWidth = 1024;
settings.paddingX = 1;
settings.paddingY = 1;
settings.filterMin = TextureFilter.Linear;
settings.filterMag = TextureFilter.Linear;
TexturePacker.process(settings, "dataPC/screens/play/", "data/screens/play/", "play");
TexturePacker.process(settings, "dataPC/screens/background/", "data/screens/background", "bg");
}
new LwjglApplication(new Bar(resolver), "Bar", 480, 854, true);
}
示例7: packImages
import com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings; //导入依赖的package包/类
public static void packImages() {
File dir = new File(root);
String inputDir = "";
String outputDir = "";
String outputFile = "";
String[] content = dir.list();
Settings settings = new Settings();
settings.maxWidth = 2048;
settings.maxHeight = 2048;
settings.pot = false;
for (int i = 0; i < content.length; i++) {
if (new File(root + filesep + content[i]).isDirectory()) {
inputDir = root + filesep + content[i];
outputDir = root + filesep + content[i];
outputFile = content[i] + ".atlas";
TexturePacker.processIfModified(settings, inputDir, outputDir, outputFile);
}
}
}
示例8: createAtlas
import com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings; //导入依赖的package包/类
private void createAtlas(FileHandle directory, String atlasName) {
Settings settings = new Settings();
settings.minWidth = 32;
settings.minHeight = 32;
settings.maxWidth = 2048;
settings.maxHeight = 2048;
settings.pot = true;
settings.paddingX = 0;
settings.paddingY = 0;
String inputDirectory = directory.path();
String outputDirectory = directory.path();
String packFileName = atlasName;
TexturePacker.process(settings, inputDirectory, outputDirectory, packFileName);
}
示例9: pack
import com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings; //导入依赖的package包/类
public static void pack(String input_asset_folder,String output_asset_folder,String output_file_name) {
Settings settings = new Settings();
settings.useIndexes = use_index;
settings.pot = true;
settings.maxWidth = size;
settings.maxHeight = size;
settings.alias = false;
// settings.stripWhitespaceX = strip_whitespace;//
// settings.stripWhitespaceY = strip_whitespace;
settings.atlasExtension = extension;
TexturePacker.process(settings, input_folder+"/"+input_asset_folder,output_folder+output_asset_folder, output_file_name);
}
示例10: main
import com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings; //导入依赖的package包/类
public static void main(String[] arg) {
Settings settings = new Settings();
settings.combineSubdirectories = true;
settings.maxWidth = settings.maxHeight = 2048;
// com.badlogic.gdx.tools.texturepacker.TexturePacker.process(settings, "tmp/ui/skins", "packed/ui/skins/", "uiskin");
// com.badlogic.gdx.tools.texturepacker.TexturePacker.process(settings, "tmp/ui/icons", "../core/assets/skins/icons", "icons");
// com.badlogic.gdx.tools.texturepacker.TexturePacker.process(settings, "tmp/characters", "packed/characters", "characters");
com.badlogic.gdx.tools.texturepacker.TexturePacker.process(settings, "tmp/items", "packed/items", "items");
}
示例11: main
import com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings; //导入依赖的package包/类
public static void main (String[] arg) {
final boolean needToPackTexture=false;
if(needToPackTexture)
{
// for high resolution (1280x720)
Settings settings=new Settings();
settings.maxHeight=2048;
settings.maxWidth=2048;
settings.filterMin=TextureFilter.MipMapLinearLinear;
settings.filterMag=TextureFilter.Linear;
settings.fast=true;
settings.duplicatePadding=true;
settings.scale=new float[]{1,0.5f};
settings.scaleSuffix=new String[]{"e","e_small"};
TexturePacker.process(settings, "../../images", ".", "gam");
// for lower resolution
settings.maxHeight=1024;
settings.maxWidth=1024;
//TexturePacker.process(settings, "../../images_small", ".", "game_small");
}
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.width=482;
config.height=320;
//config.width=320;
//config.height=480;
config.useGL30 = false;
ShapeClearGame game=new ShapeClearGame();
game.platformSpecific=new DesktopSpecific();
new LwjglApplication(game, config);
}
示例12: texturePack
import com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings; //导入依赖的package包/类
@Override
public void texturePack(Array<FileHandle> handles, FileHandle localFile, FileHandle targetFile) {
//copy defaults.json to temp folder if it doesn't exist
FileHandle fileHandle = Gdx.files.local("texturepacker/defaults.json");
if (!fileHandle.exists()) {
Gdx.files.internal("defaults.json").copyTo(fileHandle);
}
Json json = new Json();
Settings settings = json.fromJson(Settings.class, fileHandle);
TexturePacker p = new TexturePacker(settings);
for (FileHandle handle : handles) {
if (handle.exists()) {
p.addImage(handle.file());
} else {
if (localFile != null) {
FileHandle localHandle = localFile.sibling(localFile.nameWithoutExtension() + "_data/" + handle.name());
if (localHandle.exists()) {
p.addImage(localHandle.file());
} else {
Gdx.app.error(getClass().getName(), "File does not exist error while creating texture atlas: " + handle.path());
}
} else {
Gdx.app.error(getClass().getName(), "File does not exist error while creating texture atlas: " + handle.path());
}
}
}
p.pack(targetFile.parent().file(), targetFile.nameWithoutExtension());
}
示例13: TexturePackerFileProcessor
import com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings; //导入依赖的package包/类
public TexturePackerFileProcessor (Settings defaultSettings, String packFileName) {
this.defaultSettings = defaultSettings;
if (packFileName.toLowerCase().endsWith(defaultSettings.atlasExtension.toLowerCase()))
packFileName = packFileName.substring(0, packFileName.length() - defaultSettings.atlasExtension.length());
this.packFileName = packFileName;
setFlattenOutput(true);
addInputSuffix(".png", ".jpg", ".jpeg");
}
示例14: merge
import com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings; //导入依赖的package包/类
private void merge (Settings settings, File settingsFile) {
try {
json.readFields(settings, new JsonReader().parse(new FileReader(settingsFile)));
} catch (Exception ex) {
throw new GdxRuntimeException("Error reading settings file: " + settingsFile, ex);
}
}
示例15: ImageProcessor
import com.badlogic.gdx.tools.texturepacker.TexturePacker.Settings; //导入依赖的package包/类
/** @param rootDir Used to strip the root directory prefix from image file names, can be null. */
public ImageProcessor (File rootDir, Settings settings) {
this.settings = settings;
if (rootDir != null) {
rootPath = rootDir.getAbsolutePath().replace('\\', '/');
if (!rootPath.endsWith("/")) rootPath += "/";
}
}