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


Java SelectBoxStyle类代码示例

本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.SelectBox.SelectBoxStyle的典型用法代码示例。如果您正苦于以下问题:Java SelectBoxStyle类的具体用法?Java SelectBoxStyle怎么用?Java SelectBoxStyle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SelectBoxStyle类属于com.badlogic.gdx.scenes.scene2d.ui.SelectBox包,在下文中一共展示了SelectBoxStyle类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createUI

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox.SelectBoxStyle; //导入依赖的package包/类
private void createUI () {
	skin = new Skin(Gdx.files.internal("data/uiskin.json"));
	ui = new Stage();

	String[] filters = new String[TextureFilter.values().length];
	int idx = 0;
	for (TextureFilter filter : TextureFilter.values()) {
		filters[idx++] = filter.toString();
	}
	hwMipMap = new CheckBox("Hardware Mips", skin);
	minFilter = new SelectBox(skin);
	minFilter.setItems(filters);
	magFilter = new SelectBox(skin.get(SelectBoxStyle.class));
	magFilter.setItems("Nearest", "Linear");

	Table table = new Table();
	table.setSize(ui.getWidth(), 30);
	table.setY(ui.getHeight() - 30);
	table.add(hwMipMap).spaceRight(5);
	table.add(new Label("Min Filter", skin)).spaceRight(5);
	table.add(minFilter).spaceRight(5);
	table.add(new Label("Mag Filter", skin)).spaceRight(5);
	table.add(magFilter);

	ui.addActor(table);
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:27,代码来源:MipMapTest.java

示例2: addSelectBox

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox.SelectBoxStyle; //导入依赖的package包/类
public <E> void addSelectBox(String label, E selected, E[] values, Consumer<E> lis) {
  LabelStyle style = skin.get(LabelStyle.class);
  Label l = new Label(label, style);
  table.add(l).minHeight(l.getMinHeight()).prefHeight(l.getPrefHeight());

  SelectBox<E> sb = new SelectBox<E>(skin.get(SelectBoxStyle.class));
  sb.setItems(values);
  sb.setSelected(selected);
  sb.addListener(new ChangeListener() {
    @Override
    public void changed(ChangeEvent event, Actor actor) {
      lis.accept(sb.getSelected());
    }
  });
  Cell<SelectBox<E>> right = table.add(sb).minHeight(sb.getMinHeight()).prefHeight(sb.getMinHeight());
  if (nbColumns > 2)
    right.colspan(nbColumns - 1);

  table.row();
}
 
开发者ID:guillaume-alvarez,项目名称:ShapeOfThingsThatWere,代码行数:21,代码来源:FramedMenu.java

示例3: addBooleanSelectBox

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox.SelectBoxStyle; //导入依赖的package包/类
public void addBooleanSelectBox(String label, boolean selected, Consumer<Boolean> lis) {
  LabelStyle style = skin.get(LabelStyle.class);
  Label l = new Label(label, style);
  table.add(l).minHeight(l.getMinHeight()).prefHeight(l.getPrefHeight());

  SelectBox<Boolean> sb = new SelectBox<Boolean>(skin.get(SelectBoxStyle.class));
  sb.setItems(Boolean.TRUE, Boolean.FALSE);
  sb.setSelected(selected);
  sb.addListener(new ChangeListener() {
    @Override
    public void changed(ChangeEvent event, Actor actor) {
      lis.accept(sb.getSelected());
    }
  });
  Cell<SelectBox<Boolean>> right = table.add(sb).minHeight(sb.getMinHeight()).prefHeight(sb.getMinHeight());
  if (nbColumns > 2)
    right.colspan(nbColumns - 1);

  table.row();
}
 
开发者ID:guillaume-alvarez,项目名称:ShapeOfThingsThatWere,代码行数:21,代码来源:FramedMenu.java

示例4: setupUI

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox.SelectBoxStyle; //导入依赖的package包/类
public void setupUI () {
	ui = new Stage();
	skin = new Skin(Gdx.files.internal("data/uiskin.json"));
	TextButton reload = new TextButton("Reload Shaders", skin.get(TextButtonStyle.class));
	camera = new SelectBox(skin.get(SelectBoxStyle.class));
	camera.setItems("Camera", "Light");
	fps = new Label("fps: ", skin.get(LabelStyle.class));

	Table table = new Table();
	table.setFillParent(true);
	table.top().padTop(15);
	table.add(reload).spaceRight(5);
	table.add(camera).spaceRight(5);
	table.add(fps);
	ui.addActor(table);

	reload.addListener(new ClickListener() {
		public void clicked (InputEvent event, float x, float y) {
			ShaderProgram prog = new ShaderProgram(Gdx.files.internal("data/shaders/projtex-vert.glsl").readString(), Gdx.files
				.internal("data/shaders/projtex-frag.glsl").readString());
			if (prog.isCompiled() == false) {
				Gdx.app.log("GLSL ERROR", "Couldn't reload shaders:\n" + prog.getLog());
			} else {
				projTexShader.dispose();
				projTexShader = prog;
			}
		}
	});
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:30,代码来源:ProjectiveTextureTest.java

示例5: onFinishLoading

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox.SelectBoxStyle; //导入依赖的package包/类
@Override
public void onFinishLoading() {
    Skin skin = getSkin(Assets.Skin.UI_SKIN);
    BitmapFont menuFont = getFont(game.deviceSettings.menuFont);
    BitmapFont screenTitle = getFont(game.deviceSettings.screenTitleFont);
    BitmapFont hudFont = getFont(game.deviceSettings.hudFont);
    BitmapFont rulesFont = getFont(game.deviceSettings.rulesFont);

    skin.get(Assets.Skin.SKIN_STYLE_MENU, TextButtonStyle.class).font = menuFont;
    skin.get(Assets.Skin.SKIN_STYLE_GAME, TextButtonStyle.class).font = hudFont;
    skin.get(Assets.Skin.SKIN_STYLE_DIALOG, TextButtonStyle.class).font = hudFont;

    skin.get(Assets.Skin.SKIN_STYLE_MENU, ImageTextButtonStyle.class).font = menuFont;
    skin.get(Assets.Skin.SKIN_STYLE_GAME, ImageTextButtonStyle.class).font = hudFont;

    skin.get(Assets.Skin.SKIN_STYLE_MENU, SelectBoxStyle.class).font = menuFont;
    skin.get(Assets.Skin.SKIN_STYLE_MENU, SelectBoxStyle.class).listStyle.font = menuFont;
    skin.get(Assets.Skin.SKIN_STYLE_GAME, SelectBoxStyle.class).font = hudFont;
    skin.get(Assets.Skin.SKIN_STYLE_GAME, SelectBoxStyle.class).listStyle.font = hudFont;

    skin.get(Assets.Skin.SKIN_STYLE_DIALOG, WindowStyle.class).titleFont = hudFont;

    skin.get(Assets.Skin.SKIN_STYLE_MENU, LabelStyle.class).font = menuFont;
    skin.get(Assets.Skin.SKIN_STYLE_SCREEN_TITLE, LabelStyle.class).font = screenTitle;

    skin.get(Assets.Skin.SKIN_STYLE_GAME, LabelStyle.class).font = hudFont;
    skin.get(Assets.Skin.SKIN_STYLE_DIALOG, LabelStyle.class).font = hudFont;
    skin.get(Assets.Skin.SKIN_STYLE_PLAYER_TAG, LabelStyle.class).font = hudFont;
    skin.get(Assets.Skin.SKIN_STYLE_RULES, LabelStyle.class).font = rulesFont;

    skin.get(Assets.Skin.SKIN_STYLE_MENU, TextFieldStyle.class).font = menuFont;
    skin.get(Assets.Skin.SKIN_STYLE_GAME, TextFieldStyle.class).font = hudFont;

    skin.get(Assets.Skin.SKIN_STYLE_MENU, CheckBoxStyle.class).font = menuFont;
    skin.get(Assets.Skin.SKIN_STYLE_GAME, CheckBoxStyle.class).font = hudFont;

    skin.get(Assets.Skin.SKIN_STYLE_MENU, ListStyle.class).font = menuFont;
    skin.get(Assets.Skin.SKIN_STYLE_GAME, ListStyle.class).font = hudFont;
}
 
开发者ID:apotapov,项目名称:tafl,代码行数:40,代码来源:TaflGraphicsService.java

示例6: resetProperties

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox.SelectBoxStyle; //导入依赖的package包/类
public void resetProperties() {
    properties.clear();
    
    if (clazz.equals(Button.class)) {
        newStyleProperties(ButtonStyle.class);
    } else if (clazz.equals(CheckBox.class)) {
        newStyleProperties(CheckBoxStyle.class);
        properties.get("checkboxOn").optional = false;
        properties.get("checkboxOff").optional = false;
        properties.get("font").optional = false;
    } else if (clazz.equals(ImageButton.class)) {
        newStyleProperties(ImageButtonStyle.class);
    } else if (clazz.equals(ImageTextButton.class)) {
        newStyleProperties(ImageTextButtonStyle.class);
        properties.get("font").optional = false;
    } else if (clazz.equals(Label.class)) {
        newStyleProperties(LabelStyle.class);
        properties.get("font").optional = false;
    } else if (clazz.equals(List.class)) {
        newStyleProperties(ListStyle.class);
        properties.get("font").optional = false;
        properties.get("fontColorSelected").optional = false;
        properties.get("fontColorUnselected").optional = false;
        properties.get("selection").optional = false;
    } else if (clazz.equals(ProgressBar.class)) {
        newStyleProperties(ProgressBarStyle.class);
        
        //Though specified as optional in the doc, there are bugs without "background" being mandatory
        properties.get("background").optional = false;
    } else if (clazz.equals(ScrollPane.class)) {
        newStyleProperties(ScrollPaneStyle.class);
    } else if (clazz.equals(SelectBox.class)) {
        newStyleProperties(SelectBoxStyle.class);
        properties.get("font").optional = false;
        properties.get("fontColor").optional = false;
        properties.get("scrollStyle").optional = false;
        properties.get("scrollStyle").value = "default";
        properties.get("listStyle").optional = false;
        properties.get("listStyle").value = "default";
    } else if (clazz.equals(Slider.class)) {
        newStyleProperties(SliderStyle.class);
        
        //Though specified as optional in the doc, there are bugs without "background" being mandatory
        properties.get("background").optional = false;
    } else if (clazz.equals(SplitPane.class)) {
        newStyleProperties(SplitPaneStyle.class);
        properties.get("handle").optional = false;
    } else if (clazz.equals(TextButton.class)) {
        newStyleProperties(TextButtonStyle.class);
        properties.get("font").optional = false;
    } else if (clazz.equals(TextField.class)) {
        newStyleProperties(TextFieldStyle.class);
        properties.get("font").optional = false;
        properties.get("fontColor").optional = false;
    } else if (clazz.equals(TextTooltip.class)) {
        newStyleProperties(TextTooltipStyle.class);
        properties.get("label").optional = false;
        properties.get("label").value = "default";
    } else if (clazz.equals(Touchpad.class)) {
        newStyleProperties(TouchpadStyle.class);
    } else if (clazz.equals(Tree.class)) {
        newStyleProperties(TreeStyle.class);
        properties.get("plus").optional = false;
        properties.get("minus").optional = false;
    } else if (clazz.equals(Window.class)) {
        newStyleProperties(WindowStyle.class);
        properties.get("titleFont").optional = false;
    }
}
 
开发者ID:raeleus,项目名称:skin-composer,代码行数:70,代码来源:StyleData.java

示例7: ModuleSelectionScreen

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox.SelectBoxStyle; //导入依赖的package包/类
public ModuleSelectionScreen(FishchickenGame game) {
	super();
	this.skin = new SkinWithTrueTypeFonts(Gdx.files.internal(ModuleSelectionScreen.SKIN_PATH));
	this.game = game;
	Array<FileHandle> modules = getModules();
	
	Window window = new Window("Module selection", skin);
	window.pad(30, 10, 10, 10);
	window.setModal(true);
	window.setMovable(false);
	
	TextButton exitButton = new TextButton("Exit", skin);
	exitButton.addListener(this);
	exitButton.setName("EXIT");
	
	if (modules == null) {
		window.add(new Label("No modules found.", skin)).padBottom(20).padTop(10);
		window.row();
		window.add(exitButton).fill().width(100).height(40).center();
	} else {
		moduleSelectBox = new SelectBox<SelectOption<String>>(skin.get(SelectBoxStyle.class));
		Array<SelectOption<String>> options = new Array<SelectOption<String>>();
		for (FileHandle moduleDir : modules) {
			SelectOption<String> option = new SelectOption<String>(" "+moduleDir.name(), moduleDir.name());
			options.add(option);
		}
		moduleSelectBox.setItems(options);
		
		TextButton okButton = new TextButton("Ok", skin);
		okButton.addListener(this);
		okButton.setName("OK");
		
		window.add(new Label("Please choose a module:", skin)).padBottom(10).padTop(10).left();
		window.row();
		window.add(moduleSelectBox).padBottom(20).center().minWidth(170);
		window.row();
		Table buttonsTable = new Table();
		buttonsTable.add(exitButton).fill().width(100).height(40);
		buttonsTable.add(okButton).fill().width(100).height(40).padLeft(30);
		window.add(buttonsTable).center();
	}
	window.pack();
	stage.addActor(window);
	WindowPosition.CENTER.position(window);
}
 
开发者ID:mganzarcik,项目名称:fabulae,代码行数:46,代码来源:ModuleSelectionScreen.java

示例8: getSelectBoxStyle

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox.SelectBoxStyle; //导入依赖的package包/类
public SelectBoxStyle getSelectBoxStyle() {
	return skin.get(SelectBoxStyle.class);
}
 
开发者ID:suluke,项目名称:gdx.automation,代码行数:4,代码来源:StyleHelper.java


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