本文整理匯總了Java中com.badlogic.gdx.Files.internal方法的典型用法代碼示例。如果您正苦於以下問題:Java Files.internal方法的具體用法?Java Files.internal怎麽用?Java Files.internal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.Files
的用法示例。
在下文中一共展示了Files.internal方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: Configuration
import com.badlogic.gdx.Files; //導入方法依賴的package包/類
private Configuration(final Files files, final String moduleName) {
if (configuration != null) {
this.options = configuration.options;
} else {
loadOptions(files);
}
configuration = this;
this.moduleName = moduleName;
this.moduleFolder = FOLDER_MODULES + moduleName + "/";
String file = moduleFolder + "config.xml";
try {
loadFromXML(files.internal(file));
loadingScreensConfiguration = new LoadingScreens(files.internal(Configuration.getFolderUI()
+ "loadingScreens.xml"));
} catch (final IOException e) {
throw new GdxRuntimeException("Cannot read configuration file " + file + ", aborting.", e);
}
}
示例2: main
import com.badlogic.gdx.Files; //導入方法依賴的package包/類
public static void main(String[] args) {
if (args.length != 2) {
System.err.println("Shadow Engine TMX to SMF converter");
System.err.println("Version: Don't even ask me.");
System.err.println("Usage: <process> <input> <output>");
return;
}
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
cfg.title = "shadow-tmx-to-smf";
cfg.useGL30 = false;
cfg.width = 600;
cfg.height = 480;
Files files = new LwjglFiles();
FileHandle input = files.internal(args[0]);
if (!input.exists()) {
input = files.absolute(args[0]);
}
if (input != null && !input.exists()) {
System.err.println("Input file doesn't exist internally nor absolutely!");
return;
}
FileHandle output = files.absolute(args[1]);
Converter converter = new Converter(input, output);
Converter.list.add(converter);
Converter.convertOnly = true;
BackendHelper.backend = new LWJGLBackend(cfg);
new LwjglApplication(new Shadow(), cfg);
}
示例3: main
import com.badlogic.gdx.Files; //導入方法依賴的package包/類
public static void main(String[] args) {
System.out.println("Generating Field classes ...");
System.out.println();
Files files = new LwjglFiles();
Json json = new Json();
FileHandle dir = files.internal(REPOCOMPONENTS_MAIN_PATH);
// Generate fields classes for all repo classes
buildCodeForAllClasses(files, json, dir, SCHEMAX_REPO_PACKAGE,
EDITOR_SCHEMA_DESTFOLDER);
}
示例4: buildCode
import com.badlogic.gdx.Files; //導入方法依賴的package包/類
private static String buildCode(Files files, Json json,
String originJsonSchemaPath, String targetPackageName,
String targetDirectory, boolean mainClass) {
FileHandle fh = files.internal(originJsonSchemaPath);
JsonValue next = json.fromJson(null, null, fh);
next = next.child();
String fieldsCode = "";
String headerCode = "";
String targetClassName = "";
while ((next = next.next()) != null) {
if (next.name().equals("properties")) {
JsonValue nextProperty = next.child();
fieldsCode += buildFields(nextProperty);
break;
} else if (next.name().equals("extends")) {
String relativeParentJsonSchemaPath = next.child().asString();
// Calculate directory to find parent class
String parentJsonSchemaPath = originJsonSchemaPath.substring(0,
originJsonSchemaPath.lastIndexOf("/") + 1)
+ relativeParentJsonSchemaPath;
fieldsCode += buildCode(files, json, parentJsonSchemaPath,
null, null, false);
} else if (next.name().equals("javaType") && mainClass) {
String javaType = next.asString();
String originalClassName = javaType.substring(
javaType.lastIndexOf(".") + 1, javaType.length());
targetClassName = originalClassName + "Fields";
headerCode = getClassHeader(originalClassName,
targetPackageName, targetClassName);
}
}
if (mainClass) {
if (fieldsCode.length() > 0) {
System.out.println("Generating code for class "
+ targetClassName);
String classCode = headerCode + fieldsCode + "}";
writeClass(files, classCode, targetPackageName,
targetClassName, targetDirectory);
return classCode;
} else {
System.out.println("Skipping class " + targetClassName
+ " (no properties)");
return "";
}
} else {
return fieldsCode;
}
}