本文整理汇总了Java中com.badlogic.gdx.Preferences.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java Preferences.getBoolean方法的具体用法?Java Preferences.getBoolean怎么用?Java Preferences.getBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.Preferences
的用法示例。
在下文中一共展示了Preferences.getBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyPrefs
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public void applyPrefs(Preferences prefs) {
turn = prefs.getInteger("save_turn");
playersNumber = prefs.getInteger("save_player_number");
colorNumber = prefs.getInteger("save_color_number");
if (colorNumber > FieldController.NEUTRAL_LANDS_INDEX) {
colorNumber = FieldController.NEUTRAL_LANDS_INDEX;
}
levelSize = prefs.getInteger("save_level_size");
difficulty = prefs.getInteger("save_difficulty");
GameRules.campaignMode = prefs.getBoolean("save_campaign_mode");
campaignLevelIndex = prefs.getInteger("save_current_level");
colorOffset = prefs.getInteger("save_color_offset", 0);
slayRules = prefs.getBoolean("slay_rules", true);
fogOfWar = prefs.getBoolean("fog_of_war", false);
diplomacy = prefs.getBoolean("diplomacy", false);
}
示例2: loadConfiguration
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public static void loadConfiguration() {
Preferences prefs = Gdx.app.getPreferences("ss_train_config");
offset = prefs.getInteger("offset", 0);
inputOffset = prefs.getInteger("input_offset", 0);
songVolume = prefs.getInteger("song_vol", 100);
feedbackVolume = prefs.getInteger("feedback_vol", 100);
pathToBeatmaps = prefs.getString("path_to_beatmaps", Gdx.files.getExternalStoragePath() + "sstrain");
playHintSounds = prefs.getBoolean("play_hint_sounds", false);
noteSpeed = prefs.getInteger("note_speed", 6);
overallDifficulty = prefs.getInteger("overall_difficulty", 7);
displayLine = prefs.getBoolean("display_line", true);
// default to song name sorting
sortMode = prefs.getInteger("sorting_mode", SongUtils.SORTING_MODE_SONG_NAME);
// default ascending order
sortOrder = prefs.getInteger("sorting_order", SongUtils.SORTING_MODE_ASCENDING);
// sync mode
syncMode = prefs.getInteger("sync_mode", SongUtils.SYNC_MODE_1);
}
示例3: UCIEngineInterface
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
UCIEngineInterface(String PATH) {
mProcessBuilder = new ProcessBuilder(PATH);
mService = Executors.newFixedThreadPool(1);
startEngine();
mTask = null;
Preferences pref = Gdx.app.getPreferences(GameCore.TITLE);
if (pref.getBoolean(PreferenceStrings.DEPTH_SEARCH)) {
mSearchType = "depth";
mSearchValue = pref.getInteger(PreferenceStrings.SEARCH_VALUE);
} else {
mSearchType = "movetime";
// seconds to milliseconds
mSearchValue = pref.getInteger(PreferenceStrings.SEARCH_VALUE) * 1000;
}
}
示例4: loadConfiguration
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public static void loadConfiguration() {
Preferences prefs = Gdx.app.getPreferences("sif_train_config");
offset = prefs.getInteger("offset", 0);
inputOffset = prefs.getInteger("input_offset", 0);
songVolume = prefs.getInteger("song_vol", 100);
feedbackVolume = prefs.getInteger("feedback_vol", 100);
pathToBeatmaps = prefs.getString("path_to_beatmaps", Gdx.files.getExternalStoragePath() + "beatmaps");
playHintSounds = prefs.getBoolean("play_hint_sounds", false);
noteSpeed = prefs.getInteger("note_speed", 6);
overallDifficulty = prefs.getInteger("overall_difficulty", 7);
// default to song name sorting
sortMode = prefs.getInteger("sorting_mode", SongUtils.SORTING_MODE_SONG_NAME);
sortOrder = prefs.getInteger("sorting_order", SongUtils.SORTING_MODE_ASCENDING);
// default to the new mode
randomMode = prefs.getInteger("random_mode", SongUtils.RANDOM_MODE_NEW);
// sync mode
syncMode = prefs.getInteger("sync_mode", SongUtils.SYNC_MODE_1);
}
示例5: updateApplication
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
@Override
public void updateApplication( Preferences pref )
{
int width = pref.getInteger( "resolutionX" );
int height = pref.getInteger( "resolutionY" );
Global.TargetResolution[0] = width;
Global.TargetResolution[1] = height;
Global.FPS = pref.getInteger( "fps" );
Global.AnimationSpeed = 1.0f / pref.getFloat( "animspeed" );
Global.MovementTypePathfind = pref.getBoolean( "pathfindMovement" );
Global.MusicVolume = pref.getFloat( "musicVolume" );
Global.AmbientVolume = pref.getFloat( "ambientVolume" );
Global.EffectVolume = pref.getFloat( "effectVolume" );
Global.updateVolume();
}
示例6: GameManager
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public GameManager() {
isPlayerAlive = false;
topScore = 0;
currentScore = 0;
//load top score, etc
Preferences prefs = Gdx.app.getPreferences(GameSaves);
topScore = prefs.getInteger("topscore");
isSoundOn = prefs.getBoolean("sound_on", true);
totalGamesPlayed = prefs.getInteger("total_games_played", 0);
totalScoreSum = prefs.getInteger("total_score_sum", 0);
// add all needed assets to queue
assetManager.load("fonts/arial64.fnt", BitmapFont.class);
assetManager.load("atlases/game.atlas", TextureAtlas.class);
assetManager.load("atlases/widgets.atlas", TextureAtlas.class);
assetManager.load("sounds/coin.wav", Sound.class);
assetManager.load("sounds/move.wav", Sound.class);
assetManager.load("sounds/die.wav", Sound.class);
assetManager.load("sounds/intro.ogg", Music.class);
}
示例7: StatusScreen
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public StatusScreen(CaramelosGame game, boolean victory,int level)
{
this.game = game;
this.victory = victory;
this.level = level;
Preferences prefs = Gdx.app.getPreferences("My Preferences");
flagSound = prefs.getBoolean("sound");
if(victory)
mp3Music = Gdx.audio.newMusic(Gdx.files.internal("Music/Victory.mp3"));
else{
mp3Music = Gdx.audio.newMusic(Gdx.files.internal("Music/GameOver.mp3"));
}
mp3Music.setLooping(true);
if(flagSound){
mp3Music.play();
}
FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("Vollkorn/Vollkorn-Regular.ttf"));
FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
parameter.size = 24;
font12 = generator.generateFont(parameter); // font size 12 pixels
generator.dispose(); // don't forget to dispose to avoid memory leaks!
FileHandle baseFileHandle = Gdx.files.internal("Messages/menus");
String localeLanguage =java.util.Locale.getDefault().toString();
Locale locale = new Locale(localeLanguage);
I18NBundle myBundle = I18NBundle.createBundle(baseFileHandle, locale,"UTF-8");
menulevel = myBundle.get("menulevel");
menuvictory = myBundle.get("menuvictory");
menuchampion = myBundle.get("menuchampion");
menucontinue = myBundle.get("menucontinue");
menugameover = myBundle.get("menugameover");
}
示例8: checkToImportOldProgress
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
private void checkToImportOldProgress(Preferences preferences) {
boolean imported_old_progress;
imported_old_progress = preferences.getBoolean("imported_old_progress", false);
if (imported_old_progress) return;
importOldProgress();
preferences.putBoolean("imported_old_progress", true);
}
示例9: load
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public void load() {
Preferences preferences = Gdx.app.getPreferences(key);
campaignMode = preferences.getBoolean("campaign");
numberOfHumans = preferences.getInteger("players");
date = preferences.getString("date", "-");
levelIndex = preferences.getInteger("level_index", -1);
}
示例10: loadFromPreferences
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public void loadFromPreferences(String prefsKey) {
Preferences preferences = Gdx.app.getPreferences(prefsKey);
initialLevelString = preferences.getString("initial");
tempSlayRules = preferences.getBoolean("slay_rules");
tempColorOffset = preferences.getInteger("color_offset", 0);
realNumberOfHumans = preferences.getInteger("real_human_number", 0);
stringActions = preferences.getString("actions");
}
示例11: loadLanguage
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public static void loadLanguage() {
Preferences preferences = Gdx.app.getPreferences(prefs);
autoDetect = preferences.getBoolean("auto", true);
if (!autoDetect) {
langName = preferences.getString("lang_name");
LanguagesManager.getInstance().setLanguage(langName);
}
}
示例12: checkToImportOldSaves
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
private void checkToImportOldSaves() {
Preferences preferences = getPreferences(SAVE_SLOT_PREFS);
boolean importedOldSaves = preferences.getBoolean("imported_old_saves", false);
if (importedOldSaves) return;
preferences.putBoolean("imported_old_saves", true);
preferences.flush();
performImportOldSaves();
}
示例13: getNameString
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public static String getNameString(Preferences slotPrefs) {
String multiMode = "";
if (slotPrefs.getInteger("save_player_number") > 1) {
multiMode = " [" + slotPrefs.getInteger("save_player_number") + "x]";
}
if (slotPrefs.getBoolean("save_campaign_mode")) {
return LanguagesManager.getInstance().getString("choose_game_mode_campaign") + " " + slotPrefs.getInteger("save_current_level");
} else {
return LanguagesManager.getInstance().getString("choose_game_mode_skirmish") + multiMode;
}
}
示例14: readSound
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
void readSound()
{
Preferences prefs = Gdx.app.getPreferences("My Preferences");
sound=prefs.getBoolean("sound",true);
prefs.flush();
}
示例15: DicePreferences
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public DicePreferences(Preferences preferences, App app) {
this.preferences = preferences;
this.app = app;
volume = preferences.getFloat("volume", 0.5f);
language = preferences.getString("language", Locale.getDefault().getLanguage());
scale = preferences.getInteger("scale", (int) ScreenHelper.scaleFor(Gdx.graphics.getWidth(), Gdx.app.getType() == Application.ApplicationType.Desktop));
rated = preferences.getBoolean("rated");
music = preferences.getBoolean("music", true);
servicesPaneShownByDefault = preferences.getBoolean("services-pane", false);
applyVolume();
applyMusic();
}