本文整理匯總了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();
}