문제

I'm building a game with Libgdx, and while implementing the save game using Libgdx preferences, I thought I'd ask if this will also work with iOS (using RoboVM). If not I will have to use another way to save game.

I would test it myself, but I do not currently have any iOS device. So, sorry for that :)

Here's my (simple) save code:

    public void saveGame()
    {
        Json json = new Json();
        String result = json.toJson(this.playerCharacter);
        Preferences prefs = Gdx.app.getPreferences("Shared");
        prefs.putString("SaveGame", result);
        prefs.flush();
    }
도움이 되었습니까?

해결책

Preferences should work. Several of the libgdx demo games use Preferences and work fine with the RoboVM iOS backend.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top