Skip to content

Instantly share code, notes, and snippets.

@flaiker flaiker/LevelSelectionScreen.java Secret
Last active Aug 29, 2015

Embed
What would you like to do?
FileHandle[] handle = Gdx.files.internal("maps").list();
int mapCount = 0;
for (FileHandle file : handle) {
Gdx.app.log(LOG, file.name() + "|" + file.extension());
if(file.extension().equals("tmx")) {
// Doesnt work
file.copyTo(Gdx.files.local("test"));
mapCount++;
}
// Doesnt work
FileHandle file1 = Gdx.files.local("local.txt");
file1.writeString("test", false);
}
Gdx.app.log(LOG, "Copied " + mapCount + " maps to local directory");
// Works
FileHandle file2 = Gdx.files.local("local2.txt");
file2.writeString("test2", false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.