本文整理汇总了Java中com.badlogic.gdx.Files.FileType.Local方法的典型用法代码示例。如果您正苦于以下问题:Java FileType.Local方法的具体用法?Java FileType.Local怎么用?Java FileType.Local使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.Files.FileType
的用法示例。
在下文中一共展示了FileType.Local方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read
import com.badlogic.gdx.Files.FileType; //导入方法依赖的package包/类
/** Returns a stream for reading this file as bytes.
* @throws GdxRuntimeException if the file handle represents a directory, doesn't exist, or could not be read. */
public InputStream read () {
if (type == FileType.Classpath || (type == FileType.Internal && !file().exists())
|| (type == FileType.Local && !file().exists())) {
InputStream input = FileHandle.class.getResourceAsStream("/" + file.getPath().replace('\\', '/'));
if (input == null) throw new GdxRuntimeException("File not found: " + file + " (" + type + ")");
return input;
}
try {
return new FileInputStream(file());
} catch (Exception ex) {
if (file().isDirectory())
throw new GdxRuntimeException("Cannot open a stream to a directory: " + file + " (" + type + ")", ex);
throw new GdxRuntimeException("Error reading file: " + file + " (" + type + ")", ex);
}
}
示例2: read
import com.badlogic.gdx.Files.FileType; //导入方法依赖的package包/类
/** Returns a stream for reading this file as bytes.
* @throw GdxRuntimeException if the file handle represents a directory, doesn't exist, or could not be read. */
public InputStream read () {
if (type == FileType.Classpath || (type == FileType.Internal && !file.exists())
|| (type == FileType.Local && !file.exists())) {
InputStream input = FileWrapper.class.getResourceAsStream("/" + file.getPath().replace('\\', '/'));
if (input == null) throw new GdxRuntimeException("File not found: " + file + " (" + type + ")");
return input;
}
try {
return new FileInputStream(file());
} catch (Exception ex) {
if (file().isDirectory())
throw new GdxRuntimeException("Cannot open a stream to a directory: " + file + " (" + type + ")", ex);
throw new GdxRuntimeException("Error reading file: " + file + " (" + type + ")", ex);
}
}
示例3: start
import com.badlogic.gdx.Files.FileType; //导入方法依赖的package包/类
/**
* @throws InitException If a fatal error occurs during initialization.
*/
public void start() throws InitException {
DesktopGdxFileSystem gdxFileSystem = openResourceFileSystem(new File("."));
IWritableFileSystem outputFileSystem = new DesktopOutputFileSystem(FileType.Local, "save/");
final Launcher launcher = new Launcher(gdxFileSystem, outputFileSystem) {
@Override
public void create() {
DesktopGraphicsUtil.setWindowIcon(gdxFileSystem);
windowedSize = DesktopGraphicsUtil.limitInitialWindowSize(Gdx.graphics);
super.create();
}
@Override
public void resize(int width, int height) {
super.resize(width, height);
if (!Gdx.graphics.isFullscreen()) {
windowedSize = Dim.of(width, height);
}
}
@Override
protected void handleInput(INativeInput input) {
super.handleInput(input);
DesktopLauncher.this.handleInput(input);
}
};
NovelPrefsStore prefs = launcher.loadPreferences();
handleCommandlineOptions(prefs);
Lwjgl3ApplicationConfiguration config = createConfig(launcher, prefs);
Lwjgl3Application app = new Lwjgl3Application(launcher, config);
app.addLifecycleListener(new LifecycleListener() {
@Override
public void resume() {
LOG.info("App resume");
}
@Override
public void pause() {
LOG.info("App pause");
}
@Override
public void dispose() {
LOG.info("App dispose");
}
});
}
示例4: file
import com.badlogic.gdx.Files.FileType; //导入方法依赖的package包/类
@Override
public File file () {
if (type == FileType.Internal) return new File(IOSFiles.internalPath, file.getPath());
if (type == FileType.External) return new File(IOSFiles.externalPath, file.getPath());
if (type == FileType.Local) return new File(IOSFiles.localPath, file.getPath());
return file;
}
示例5: file
import com.badlogic.gdx.Files.FileType; //导入方法依赖的package包/类
public File file () {
if (type == FileType.Local) return new File(Gdx.files.getLocalStoragePath(), file.getPath());
return super.file();
}
示例6: file
import com.badlogic.gdx.Files.FileType; //导入方法依赖的package包/类
@Override
public File file() {
if (type == FileType.Internal) return new File(internalPath, file.getPath());
if (type == FileType.External) return new File(externalPath, file.getPath());
if (type == FileType.Local) return new File(localPath, file.getPath());
return file;
}
示例7: file
import com.badlogic.gdx.Files.FileType; //导入方法依赖的package包/类
public File file () {
if (type == FileType.External) return new File(DesktopFileHandle.externalPath, file.getPath());
if (type == FileType.Local) return new File(DesktopFileHandle.localPath, file.getPath());
return file;
}
示例8: file
import com.badlogic.gdx.Files.FileType; //导入方法依赖的package包/类
public File file () {
if (type == FileType.External) return new File(JglfwFiles.externalPath, file.getPath());
if (type == FileType.Local) return new File(JglfwFiles.localPath, file.getPath());
return file;
}
示例9: file
import com.badlogic.gdx.Files.FileType; //导入方法依赖的package包/类
public File file () {
if (type == FileType.External) return new File(HeadlessFiles.externalPath, file.getPath());
if (type == FileType.Local) return new File(HeadlessFiles.localPath, file.getPath());
return file;
}
示例10: file
import com.badlogic.gdx.Files.FileType; //导入方法依赖的package包/类
public File file () {
if (type == FileType.External) return new File(LwjglFiles.externalPath, file.getPath());
if (type == FileType.Local) return new File(LwjglFiles.localPath, file.getPath());
return file;
}
示例11: file
import com.badlogic.gdx.Files.FileType; //导入方法依赖的package包/类
public File file () {
if (type == FileType.Local) return new File(Gdx.files.getLocalStoragePath(), file.getPath());
return super.file();
}