本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.CheckBox.CheckBoxStyle类的典型用法代码示例。如果您正苦于以下问题:Java CheckBoxStyle类的具体用法?Java CheckBoxStyle怎么用?Java CheckBoxStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CheckBoxStyle类属于com.badlogic.gdx.scenes.scene2d.ui.CheckBox包,在下文中一共展示了CheckBoxStyle类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addCheckBox
import com.badlogic.gdx.scenes.scene2d.ui.CheckBox.CheckBoxStyle; //导入依赖的package包/类
public void addCheckBox(String text, boolean checked, Consumer<Boolean> lis) {
CheckBoxStyle style = skin.get(CheckBoxStyle.class);
CheckBox cb = new CheckBox(text, style);
cb.setChecked(checked);
if (lis != null)
cb.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
lis.accept(Boolean.valueOf(cb.isChecked()));
}
});
table.add(cb).colspan(nbColumns).minHeight(cb.getMinHeight()).prefHeight(cb.getPrefHeight());
table.row();
}
开发者ID:guillaume-alvarez,项目名称:ShapeOfThingsThatWere,代码行数:16,代码来源:FramedMenu.java
示例2: createCheckboxStyle
import com.badlogic.gdx.scenes.scene2d.ui.CheckBox.CheckBoxStyle; //导入依赖的package包/类
/**
* Erstellt den {@link CheckBoxStyle} für die Methode createCheckbox.
*
* @return {@link CheckBoxStyle}
*/
private CheckBoxStyle createCheckboxStyle() {
Drawable on = new TextureRegionDrawable(AssetManager.getTextureRegion("ui", "on"));
Drawable off = new TextureRegionDrawable(AssetManager.getTextureRegion("ui", "off"));
CheckBoxStyle style = new CheckBoxStyle();
style.checkboxOn = on;
style.checkboxOff = off;
style.font = new BitmapFont(Gdx.files.internal("pictures/fontButton/font.fnt"));
return style;
}
开发者ID:PhilippGrulich,项目名称:HAW-SE2-projecthorse,代码行数:16,代码来源:Popup.java
示例3: onFinishLoading
import com.badlogic.gdx.scenes.scene2d.ui.CheckBox.CheckBoxStyle; //导入依赖的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
示例4: setUpSkin
import com.badlogic.gdx.scenes.scene2d.ui.CheckBox.CheckBoxStyle; //导入依赖的package包/类
private void setUpSkin() {
Pixmap pixmap = new Pixmap(1, 1, Format.RGBA8888);
pixmap.setColor(Color.LIGHT_GRAY);
pixmap.fill();
skin.add("grey", new Texture(pixmap));
titleSprite.setX(TITLE_SPRITE_POS_X);
titleSprite.setY(TITLE_SPRITE_POS_Y);
LabelStyle labelStyle = new LabelStyle();
skin.add("default", finePrint);
labelStyle.font = skin.getFont("default");
skin.add("default", labelStyle);
CheckBoxStyle checkBoxStyle = new CheckBoxStyle();
checkBoxStyle.checkboxOff = skin.newDrawable("grey", Color.LIGHT_GRAY);
checkBoxStyle.checkboxOn = skin.newDrawable("grey", Color.LIGHT_GRAY);
checkBoxStyle.font = skin.getFont("default");
checkBoxStyle.checkboxOff = new TextureRegionDrawable(unchecked);
checkBoxStyle.checkboxOn = new TextureRegionDrawable(checked);
skin.add("default", checkBoxStyle);
SliderStyle sliderStyle = new SliderStyle();
sliderStyle.background = new TextureRegionDrawable(background);
sliderStyle.knob = new TextureRegionDrawable(knob);
skin.add("default-horizontal", sliderStyle);
ButtonStyle buttonStyle = new ButtonStyle();
skin.add("default", buttonStyle);
TextButtonStyle textButtonStyle = new TextButtonStyle();
textButtonStyle.font = skin.getFont("default");
textButtonStyle.up = new NinePatchDrawable(patchBox);
skin.add("default", textButtonStyle);
}
开发者ID:oddlydrawn,项目名称:nahwc-g,代码行数:35,代码来源:MainMenuInterface.java
示例5: resetProperties
import com.badlogic.gdx.scenes.scene2d.ui.CheckBox.CheckBoxStyle; //导入依赖的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
示例6: getCheckBoxStyle
import com.badlogic.gdx.scenes.scene2d.ui.CheckBox.CheckBoxStyle; //导入依赖的package包/类
public CheckBoxStyle getCheckBoxStyle() {
return skin.get(CheckBoxStyle.class);
}
开发者ID:suluke,项目名称:gdx.automation,代码行数:4,代码来源:StyleHelper.java
示例7: createStyles
import com.badlogic.gdx.scenes.scene2d.ui.CheckBox.CheckBoxStyle; //导入依赖的package包/类
public void createStyles(ResourcesManager resourcesManager) {
if (!initialize) {
initialize=true;
font = resourcesManager.get(resourcesManager.DEFAULT_FONT);
font.setScale(ScaleUtil.getSizeRatio());
font.setUseIntegerPositions(false);
font2 = resourcesManager.get(resourcesManager.HEADER_FONT);
font2.setScale(ScaleUtil.getSizeRatio());
font2.setUseIntegerPositions(false);
skin = new Skin();
skin.add("default", font);
skin.add("header", font2);
skin.add("lt-blue", new Color(.62f, .76f, .99f, 1f));
skin.add("lt-green", new Color(.39f, .9f, .6f, 1f));
skin.add("dark-blue", new Color(.79f, .95f, 91f, 1f));
skin.addRegions(resourcesManager.<TextureAtlas>get(resourcesManager.GUI_ATLAS));
skin.addRegions(resourcesManager.<TextureAtlas>get(resourcesManager.GUI_PACK_ATLAS));
TextureRegionDrawable touchpad_background = new TextureRegionDrawable(((TextureAtlas) resourcesManager.get(resourcesManager.GUI_ATLAS)).findRegion("touchpad_background"));
TextureRegionDrawable touchpad_thumb = new TextureRegionDrawable(((TextureAtlas) resourcesManager.get(resourcesManager.GUI_ATLAS)).findRegion("touchpad_thumb"));
TextureRegionDrawable checkox_true = new TextureRegionDrawable(((TextureAtlas) resourcesManager.get(resourcesManager.UISKIN_ATLAS)).findRegion("check-on"));
TextureRegionDrawable checkox_false = new TextureRegionDrawable(((TextureAtlas) resourcesManager.get(resourcesManager.UISKIN_ATLAS)).findRegion("check-off"));
TextureRegionDrawable slider_knob = new TextureRegionDrawable(((TextureAtlas) resourcesManager.get(resourcesManager.UISKIN_ATLAS)).findRegion("default-slider-knob"));
TextureRegionDrawable slider = new TextureRegionDrawable(((TextureAtlas) resourcesManager.get(resourcesManager.UISKIN_ATLAS)).findRegion("default-slider"));
CheckBoxStyle checkBoxStyle = new CheckBox.CheckBoxStyle(checkox_false, checkox_true, font, Color.WHITE);
SpriteDrawable stats = new SpriteDrawable(new Sprite((Texture) resourcesManager.get(resourcesManager.STATS_BACKGROUND)));
SliderStyle sliderStyle = new SliderStyle(slider, slider_knob);
skin.add("default",new WindowStyle(font2,Color.ORANGE,skin.getDrawable("debug")));
skin.add("stats", stats);
LabelStyle lbs = new LabelStyle();
lbs.font = font;
lbs.fontColor = Color.WHITE;
skin.add("default", lbs);
LabelStyle lbsHeader = new LabelStyle();
lbsHeader.font = font2;
lbsHeader.fontColor = Color.WHITE;
skin.add("header", lbsHeader);
TextButtonStyle tbs = new TextButtonStyle(skin.getDrawable("btnMenu"), skin.getDrawable("btnMenuPress"), skin.getDrawable("btnMenu"), font);
tbs.fontColor = skin.getColor("dark-blue");
tbs.pressedOffsetX = Math.round(1f * Gdx.graphics.getDensity());
tbs.pressedOffsetY = tbs.pressedOffsetX * -1f;
ImageButton.ImageButtonStyle ImageButtonLeft = new ImageButton.ImageButtonStyle(skin.getDrawable("buttonLeft"), skin.getDrawable("buttonLeftPress"),
skin.getDrawable("buttonLeft"), null, null, null);
ImageButton.ImageButtonStyle ImageButtonRight = new ImageButton.ImageButtonStyle(skin.getDrawable("buttonRight"), skin.getDrawable("buttonRightPress"),
skin.getDrawable("buttonRight"), null, null, null);
ImageButton.ImageButtonStyle ImageButtonUp = new ImageButton.ImageButtonStyle(skin.getDrawable("buttonUp"), skin.getDrawable("buttonUpPress"),
skin.getDrawable("buttonUp"), null, null, null);
Touchpad.TouchpadStyle touchpadStyle = new Touchpad.TouchpadStyle();
touchpadStyle.background = touchpad_background;
touchpadStyle.knob = touchpad_thumb;
skin.add("default", tbs);
skin.add("buttonLeft", ImageButtonLeft);
skin.add("buttonRight", ImageButtonRight);
skin.add("buttonUp", ImageButtonUp);
skin.add("default", touchpadStyle);
skin.add("default", checkBoxStyle);
skin.add("default-horizontal", sliderStyle);
}
}
开发者ID:Rubentxu,项目名称:DreamsLibGdx,代码行数:81,代码来源:Styles.java
示例8: createCheckbox
import com.badlogic.gdx.scenes.scene2d.ui.CheckBox.CheckBoxStyle; //导入依赖的package包/类
/**
* Diese Methode erstellt eine Standard Checkbox.
*
* @param text
* Checkbox Text
* @return {@link CheckBox}
*/
protected CheckBox createCheckbox(final String text) {
CheckBoxStyle style = createCheckboxStyle();
CheckBox box = new CheckBox(text, style);
return box;
}
开发者ID:PhilippGrulich,项目名称:HAW-SE2-projecthorse,代码行数:14,代码来源:Popup.java
注:本文中的com.badlogic.gdx.scenes.scene2d.ui.CheckBox.CheckBoxStyle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论