本文整理匯總了Java中com.badlogic.gdx.files.FileHandle.list方法的典型用法代碼示例。如果您正苦於以下問題:Java FileHandle.list方法的具體用法?Java FileHandle.list怎麽用?Java FileHandle.list使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.files.FileHandle
的用法示例。
在下文中一共展示了FileHandle.list方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getNextModFile
import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
@Override
public ModFile getNextModFile() throws IOException {
FileHandle file = files.pollFirst();
if (file != null)
return new FolderModFile(file);
FileHandle folder = folders.pollFirst();
if (folder == null)
return null;
for (FileHandle f : folder.list()) {
if (f.isDirectory()) {
folders.add(f);
} else {
files.add(f);
}
}
return new FolderModFile(folder);
}
示例2: loadAssets
import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
public void loadAssets() {
assetManager.clear();
assetManager.load(DATA_PATH + "/skin/skin.json", Skin.class);
for (String directory : imagePacks.keys()) {
FileHandle folder = Gdx.files.local(directory);
for (FileHandle file : folder.list()) {
assetManager.load(file.path(), Pixmap.class);
imagePacks.get(directory).add(file.nameWithoutExtension());
}
}
assetManager.load(DATA_PATH + "/gfx/white.png", Pixmap.class);
assetManager.load(DATA_PATH + "/sfx/coin.wav", Sound.class);
assetManager.load(DATA_PATH + "/sfx/hit.wav", Sound.class);
assetManager.load(DATA_PATH + "/sfx/jump.wav", Sound.class);
}
示例3: preloadSfx
import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
/**
* Preloads all sfx for the game prior to execution. This ensures sfx
* will be heard the first time they are invoked.
*/
private void preloadSfx() {
FileHandle sfxDirectory = Gdx.files.internal(title + "/sfx");
for (FileHandle fileHandle: sfxDirectory.list()) {
loadSfx(fileHandle.path());
}
}
示例4: load
import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
private void load(String path) {
filesView.clearChildren();
filesView.layout();
FileHandle file = Gdx.files.absolute(path);
curFileHandle = file;
if (file.isDirectory()) {
for (FileHandle child : file.list()) {
if (child.name().startsWith(".")) continue;
loadAsset(child);
}
} else {
loadAsset(file);
}
}
示例5: getSaves
import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
public static Save[] getSaves() {
FileHandle clientSavesFolder = getSavesFolder();
if (!clientSavesFolder.isDirectory()) return new Save[0];
FileHandle[] list = clientSavesFolder.list();
Save[] saves = new Save[list.length];
for (int i = 0; i < list.length; i++) {
saves[i] = new Save(list[i].name(), list[i]);
}
return saves;
}
示例6: FolderModInputStream
import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
public FolderModInputStream(FileHandle file) {
root = file;
for (FileHandle f : file.list()) {
if (f.isDirectory()) {
folders.add(f);
} else {
files.add(f);
}
}
}
示例7: FolderModInputStream
import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
public FolderModInputStream(FileHandle file) {
root = file;
for (FileHandle f : file.list()) {
if (f.isDirectory()) {
folders.add(f);
} else {
files.add(f);
}
}
}
示例8: getNextModFile
import com.badlogic.gdx.files.FileHandle; //導入方法依賴的package包/類
@Override
public ModFile getNextModFile() throws IOException {
FileHandle file = files.pollFirst();
if (file != null) return new FolderModFile(file);
FileHandle folder = folders.pollFirst();
if (folder == null) return null;
for (FileHandle f : folder.list()) {
if (f.isDirectory()) {
folders.add(f);
} else {
files.add(f);
}
}
return new FolderModFile(folder);
}