Example usage for com.badlogic.gdx Preferences getFloat

List of usage examples for com.badlogic.gdx Preferences getFloat

Introduction

In this page you can find the example usage for com.badlogic.gdx Preferences getFloat.

Prototype

public float getFloat(String key);

Source Link

Usage

From source file:com.jmolina.orb.screens.Select.java

License:Open Source License

/**
 * Devuelve el mejor tiempo del nivel//w ww .ja v  a2  s .  co  m
 *
 * @param key Clave de nivel
 */
private Float getBestTime(ScreenManager.Key key) {
    Preferences prefs = getPrefsManager().getPrefs();

    switch (key) {
    case LEVEL_1:
        return prefs.getFloat(PrefsManager.LADDER_1_1);
    case LEVEL_2:
        return prefs.getFloat(PrefsManager.LADDER_2_1);
    case LEVEL_3:
        return prefs.getFloat(PrefsManager.LADDER_3_1);
    case LEVEL_4:
        return prefs.getFloat(PrefsManager.LADDER_4_1);
    case LEVEL_5:
        return prefs.getFloat(PrefsManager.LADDER_5_1);
    default:
        return 0f;
    }
}

From source file:com.redthirddivision.astilade.world.World.java

License:Apache License

public Player loadPlayer() {
    LogHelper.info("Loading player data");
    Preferences prefs = Gdx.app.getPreferences(Astilade.TITLE);
    Player player = new Player(this, new Vector2(prefs.getFloat("playerX"), prefs.getFloat("playerY")));

    LogHelper.info("Player data loaded");
    return player;
}