当前位置: 首页>>代码示例>>Java>>正文


Java Preferences.getFloat方法代码示例

本文整理汇总了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();
}
 
开发者ID:infinity8,项目名称:Roguelike,代码行数:18,代码来源:AndroidApplicationChanger.java

示例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();
}
 
开发者ID:ratrecommends,项目名称:dice-heroes,代码行数:13,代码来源:DicePreferences.java

示例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();
	}
 
开发者ID:nkarasch,项目名称:ChessGDX,代码行数:28,代码来源:SoundManager.java

示例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 );
}
 
开发者ID:infinity8,项目名称:Roguelike,代码行数:40,代码来源:LwjglApplicationChanger.java

示例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" ) );
}
 
开发者ID:infinity8,项目名称:Roguelike,代码行数:38,代码来源:LwjglApplicationChanger.java

示例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();
}
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:55,代码来源:MainController.java

示例7: extractFloatFrom

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
@Override
public float extractFloatFrom(final Preferences preferences) {
    return preferences.getFloat(getName());
}
 
开发者ID:gdx-libs,项目名称:gdx-kiwi,代码行数:5,代码来源:PreferenceWrapper.java

示例8: extractFloatOrElse

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
@Override
public float extractFloatOrElse(final Preferences preferences, final float defaultValue) {
    return preferences.getFloat(getName(), defaultValue);
}
 
开发者ID:gdx-libs,项目名称:gdx-kiwi,代码行数:5,代码来源:PreferenceWrapper.java

示例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());
}
 
开发者ID:CymricNPG,项目名称:abattle,代码行数:5,代码来源:Helper.java

示例10: getFloatFrom

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
@Override
public float getFloatFrom(final Preferences preferences) {
    return preferences.getFloat(getName());
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:5,代码来源:PreferenceWrapper.java

示例11: getFloatOrElse

import com.badlogic.gdx.Preferences; //导入方法依赖的package包/类
@Override
public float getFloatOrElse(final Preferences preferences, final float defaultValue) {
    return preferences.getFloat(getName(), defaultValue);
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:5,代码来源:PreferenceWrapper.java


注:本文中的com.badlogic.gdx.Preferences.getFloat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。