本文整理汇总了Java中com.badlogic.gdx.Preferences.getFloat方法的典型用法代码示例。如果您正苦于以下问题:Java Preferences.getFloat方法的具体用法?Java Preferences.getFloat怎么用?Java Preferences.getFloat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.Preferences
的用法示例。
在下文中一共展示了Preferences.getFloat方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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();
}
示例3: SoundManager
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
private SoundManager() {
Preferences pref = Gdx.app.getPreferences(GameCore.TITLE);
mEffectsVolume = 1.0f;
mAmbience = AssetHandler.getInstance().getMusic("sound/nature.mp3");
mClicked = AssetHandler.getInstance().getSound("sound/click.wav");
mReleased = AssetHandler.getInstance().getSound("sound/release.wav");
mMove = AssetHandler.getInstance().getSound("sound/move.wav");
if (pref.contains(PreferenceStrings.MUSIC_VOLUME)) {
mAmbience.setVolume(pref.getFloat(PreferenceStrings.MUSIC_VOLUME) / 100.0f);
} else {
pref.putFloat(PreferenceStrings.MUSIC_VOLUME, 1.0f);
}
if (pref.contains(PreferenceStrings.EFFECTS_VOLUME)) {
mEffectsVolume = pref.getFloat(PreferenceStrings.EFFECTS_VOLUME) / 100.0f;
} else {
pref.putFloat(PreferenceStrings.EFFECTS_VOLUME, 1.0f);
}
mAmbience.setLooping(true);
mAmbience.play();
pref.flush();
}
示例4: createApplication
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
@Override
public Application createApplication( RoguelikeGame game, Preferences pref )
{
System.setProperty( "org.lwjgl.opengl.Window.undecorated", "" + pref.getBoolean( "borderless" ) );
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
cfg.title = "A Skin of Others";
cfg.width = pref.getInteger( "resolutionX" );
cfg.height = pref.getInteger( "resolutionY" );
cfg.fullscreen = pref.getBoolean( "fullscreen" );
cfg.vSyncEnabled = pref.getBoolean( "vSync" );
cfg.foregroundFPS = 0;
cfg.backgroundFPS = 2;
cfg.samples = pref.getInteger( "msaa" );
cfg.addIcon( "Sprites/Unpacked/Icon32.png", FileType.Internal );
cfg.allowSoftwareMode = true;
Global.TargetResolution[0] = cfg.width;
Global.TargetResolution[1] = cfg.height;
Global.ScreenSize[0] = cfg.width;
Global.ScreenSize[1] = cfg.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();
for ( Controls.Keys key : Controls.Keys.values() )
{
Global.Controls.setKeyMap( key, pref.getInteger( key.toString() ) );
}
return new LwjglApplication( game, cfg );
}
示例5: updateApplication
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
@Override
public void updateApplication( Preferences pref )
{
System.setProperty( "org.lwjgl.opengl.Window.undecorated", "" + pref.getBoolean( "borderless" ) );
int width = pref.getInteger( "resolutionX" );
int height = pref.getInteger( "resolutionY" );
boolean fullscreen = pref.getBoolean( "fullscreen" );
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();
for ( Controls.Keys key : Controls.Keys.values() )
{
Global.Controls.setKeyMap( key, pref.getInteger( key.toString() ) );
}
if (fullscreen)
{
DisplayMode mode = Gdx.graphics.getDisplayMode();
Gdx.graphics.setFullscreenMode( mode );
}
else
{
Gdx.graphics.setWindowedMode( width, height );
}
//Gdx.graphics.setVSync( pref.getBoolean( "vSync" ) );
}
示例6: initialize
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@LmlAfter
void initialize() {
fileTypeControllers.put(WidgetData.FileType.PNG, ftPngController);
fileTypeControllers.put(WidgetData.FileType.JPEG, ftJpegController);
fileTypeControllers.put(WidgetData.FileType.KTX, ftKtxController);
for (int i = 0; i < fileTypeControllers.size; i++) {
FileTypeController ftc = fileTypeControllers.getValueAt(i);
ftc.onViewCreated(stage);
}
actorsPackSettings.cboMinFilter.setItems(WidgetData.textureFilters);
actorsPackSettings.cboMagFilter.setItems(WidgetData.textureFilters);
actorsPackSettings.cboWrapX.setItems(WidgetData.textureWraps);
actorsPackSettings.cboWrapY.setItems(WidgetData.textureWraps);
actorsGlobalSettings.cboFileType.setItems(WidgetData.FileType.values());
actorsPacks.packList = actorsPacks.packListTable.getListView();
actorsPacks.packListAdapter = ((PackListAdapter) actorsPacks.packList.getAdapter());
actorsPacks.packListAdapter.getSelectionManager().setListener(new ListSelectionAdapter<PackModel, VisTable>() {
@Override
public void selected(PackModel pack, VisTable view) {
getProject().setSelectedPack(pack);
Gdx.app.postRunnable(normalizePackListScrollRunnable);
}
});
toastManager = new ToastManager(toastHostGroup);
toastManager.setAlignment(Align.bottomRight);
canvasController.initialize(canvas);
packInputFilesController.onViewCreated(stage);
fileDragDropController.onViewCreated(stage);
// Load pack list split value
{
Preferences prefs = Gdx.app.getPreferences(AppConstants.PREF_NAME_COMMON);
float splitValue = prefs.getFloat(PREF_KEY_PACK_LIST_SPLIT, 0f);
packListSplitPane.setSplitAmount(splitValue);
}
outputDirTooltip = new Tooltip();
outputDirTooltip.setAppearDelayTime(0.25f);
outputDirTooltip.setTouchable(Touchable.disabled);
outputDirTooltip.setText(getString("packGeneralTtOutputDir"));
outputDirTooltip.setTarget(actorsPacks.edtOutputDir);
initialized = true;
updatePackList();
updateViewsFromPack(getSelectedPack());
updateRecentProjects();
updateFileType();
}
示例7: extractFloatFrom
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
@Override
public float extractFloatFrom(final Preferences preferences) {
return preferences.getFloat(getName());
}
示例8: extractFloatOrElse
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
@Override
public float extractFloatOrElse(final Preferences preferences, final float defaultValue) {
return preferences.getFloat(getName(), defaultValue);
}
示例9: getfloat
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
public static float getfloat(final Preferences properties, final String key, final String defaultValue) {
Float _valueOf = Float.valueOf(defaultValue);
return properties.getFloat(key, (_valueOf).floatValue());
}
示例10: getFloatFrom
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
@Override
public float getFloatFrom(final Preferences preferences) {
return preferences.getFloat(getName());
}
示例11: getFloatOrElse
import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
@Override
public float getFloatOrElse(final Preferences preferences, final float defaultValue) {
return preferences.getFloat(getName(), defaultValue);
}