本文整理匯總了Java中com.badlogic.gdx.tools.texturepacker.TexturePacker.process方法的典型用法代碼示例。如果您正苦於以下問題:Java TexturePacker.process方法的具體用法?Java TexturePacker.process怎麽用?Java TexturePacker.process使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.tools.texturepacker.TexturePacker
的用法示例。
在下文中一共展示了TexturePacker.process方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: main
import com.badlogic.gdx.tools.texturepacker.TexturePacker; //導入方法依賴的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: processFolder
import com.badlogic.gdx.tools.texturepacker.TexturePacker; //導入方法依賴的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());
}
}
示例3: main
import com.badlogic.gdx.tools.texturepacker.TexturePacker; //導入方法依賴的package包/類
public static void main(String...args) throws Exception{
TexturePacker.Settings settings = new TexturePacker.Settings();
settings.stripWhitespaceX = false;
settings.stripWhitespaceY = false;
TexturePacker.process(settings, "Assets Folder/items/images", "core/assets/items", "item-icons");
TexturePacker.process(settings, "Assets Folder/UI/images", "core/assets/UI", "UI");
TexturePacker.process(settings, "Assets Folder/res/images", "core/assets/res", "res");
}
示例4: main
import com.badlogic.gdx.tools.texturepacker.TexturePacker; //導入方法依賴的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; //導入方法依賴的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: perform
import com.badlogic.gdx.tools.texturepacker.TexturePacker; //導入方法依賴的package包/類
@Override
public Boolean perform() {
TexturePacker.Settings settings = new TexturePacker.Settings();
settings.grid = true;
settings.square = true;
settings.paddingX = 2;
settings.paddingY = 2;
TexturePacker.process(settings, Gdx.files.internal("raw/blocks").path(), Gdx.files.internal("graphics/textures/").path(), "tilemap.atlas");
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
ForgE.blocks.reload();
return true;
}
示例7: perform
import com.badlogic.gdx.tools.texturepacker.TexturePacker; //導入方法依賴的package包/類
@Override
public Boolean perform() {
TexturePacker.Settings settings = new TexturePacker.Settings();
settings.grid = true;
settings.square = true;
settings.paddingX = 2;
settings.paddingY = 2;
TexturePacker.process(settings, Gdx.files.internal(RAW_UI_IMAGES_PATH).path(), Gdx.files.internal(UIManager.STORE_PATH).path(), "ui.atlas");
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
return true;
}
示例8: main
import com.badlogic.gdx.tools.texturepacker.TexturePacker; //導入方法依賴的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);
}
示例9: createAtlas
import com.badlogic.gdx.tools.texturepacker.TexturePacker; //導入方法依賴的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);
}
示例10: main
import com.badlogic.gdx.tools.texturepacker.TexturePacker; //導入方法依賴的package包/類
public static void main (String[] arg) {
// Create two run configurations
// 1. For texture packing. Pass 'texturepacker' as argument and use desktop/src
// as working directory
// 2. For playing game with android/assets as working directory
if (arg.length == 1 && arg[0].equals("texturepacker")) {
String outdir = "assets";
TexturePacker.Settings settings = new TexturePacker.Settings();
settings.maxWidth = 1024;
settings.maxHeight = 1024;
TexturePacker.process(settings, "images", outdir, "game");
TexturePacker.process(settings, "text-images", outdir, "text_images");
TexturePacker.process(settings, "text-images-de", outdir, "text_images_de");
}
else {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.title = "FruitCatcher";
config.width = 800;
config.height = 480;
new LwjglApplication(new FruitCatcherGame(null, "en"), config);
}
}
示例11: createProject
import com.badlogic.gdx.tools.texturepacker.TexturePacker; //導入方法依賴的package包/類
/**
*
* @param projectName
*/
public void createProject(String projectName) {
FileHandle projectFolder = Gdx.files.local("projects").child(projectName);
if (projectFolder.exists() == true) {
game.showNotice("Error", "Project name already in use!", stage);
return;
}
projectFolder.mkdirs();
projectFolder.child("assets").mkdirs();
projectFolder.child("backups").mkdirs();
game.skin.save(projectFolder.child("uiskin.json"));
// Copy assets
FileHandle assetsFolder = Gdx.files.local("resources/raw");
assetsFolder.copyTo(projectFolder.child("assets"));
// Rebuild from raw resources
TexturePacker.Settings settings = new TexturePacker.Settings();
settings.combineSubdirectories = true;
TexturePacker.process(settings, "projects/" + projectName +"/assets/", "projects/" + projectName, "uiskin");
game.showNotice("Operation completed", "New project successfully created.", stage);
refreshProjects();
}
示例12: refreshResources
import com.badlogic.gdx.tools.texturepacker.TexturePacker; //導入方法依賴的package包/類
/**
*
*/
public void refreshResources() {
TexturePacker.Settings settings = new TexturePacker.Settings();
settings.combineSubdirectories = true;
settings.maxWidth = 2048;
settings.maxHeight = 2048;
TexturePacker.process(settings, "projects/" + currentProject +"/assets/", "projects/" + currentProject, "uiskin");
// Load project skin
if (game.skinProject != null) {
game.skinProject.dispose();
}
game.skinProject = new Skin();
game.skinProject.addRegions(new TextureAtlas(Gdx.files.local("projects/" + currentProject +"/uiskin.atlas")));
game.skinProject.load(Gdx.files.local("projects/" + currentProject +"/uiskin.json"));
}
示例13: main
import com.badlogic.gdx.tools.texturepacker.TexturePacker; //導入方法依賴的package包/類
public static void main (String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
final double ratio = 1080.0/1920.0;
if(DS.app_orientation==DS.ORIENTATION.PORTRAIT) {
config.height = 950;
config.width = (int) (config.height * ratio);
} else {
config.width = 950;
config.height = (int) (config.width * ratio);
}
TexturePacker.Settings settings = new TexturePacker.Settings();
// settings.maxWidth = 2048;
settings.maxWidth = 4096;
settings.maxHeight = 4096;
settings.combineSubdirectories = false;
settings.flattenPaths = true;
// settings.alias = false;
// settings.debug = true;
settings.useIndexes = false;
String input_path = "Z:/hub/coding_projects/libgdx/Ponytron/00_TEXTURES";
String output_path = "Z:/hub/coding_projects/libgdx/Ponytron/android/assets";
TexturePacker.process(settings, input_path, output_path, DS.TEXTURE_ATLAS);
new LwjglApplication(new PonytronGame(), config);
}
示例14: pack
import com.badlogic.gdx.tools.texturepacker.TexturePacker; //導入方法依賴的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);
}
示例15: main
import com.badlogic.gdx.tools.texturepacker.TexturePacker; //導入方法依賴的package包/類
public static void main(String[] arg) {
if (rebuildAtlas) {
TexturePacker.Settings settings = new TexturePacker.Settings();
settings.maxWidth = 2048;
settings.maxHeight = 2048;
settings.debug = drawDebugOutline;
TexturePacker.process(settings, "raw/images", "images", "merlin-images.pack");
}
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
new LwjglApplication(new MerlinGame(), config);
}