Java 类com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle 实例源码
项目:fabulae
文件:Map.java
public Map(GameMap map, GameState gameState, int width, int height, ButtonStyle mapIndicatorStyle) {
mapTexture = MinimapGenerator.generate(map, gameState, width, height);
this.gameMap = map;
this.gameState = gameState;
calculateRatios(width, height);
Image image = new Image(mapTexture);
image.addListener(this);
// only add the current camera position indicator in case
// the camera does not show the whole map already
if (xRatio > 1 || yRatio > 1) {
indicator = new MapScreenIndicator(mapIndicatorStyle);
}
WidgetGroup group = new WidgetGroup();
group.addActor(image);
if (indicator != null) {
group.addActor(indicator);
indicator.addListener(this);
}
group.setWidth(width);
group.setHeight(height);
group.invalidate();
add(group).width(width).height(height);
}
项目:GDXJam
文件:FormationPatternTable.java
private ImageButton createFormationButton(FormationPatternType pattern, Skin skin){
ImageButtonStyle style = new ImageButtonStyle(skin.get("default", ButtonStyle.class));
Sprite sprite = new Sprite(Assets.ui.formationIcons.get(pattern.ordinal()));
sprite.setSize(26, 26);
sprite.setColor(Color.BLUE);
SpriteDrawable drawable = new SpriteDrawable(sprite);
style.imageUp = drawable;
// style.imageDown = drawable.tint(Color.CYAN);
style.imageChecked = drawable.tint(Color.RED);
ImageButton button = new ImageButton(style);
button.setUserObject(pattern);
return button;
}
项目:ShapeOfThingsThatWere
文件:FramedMenu.java
public void addButton(LabelStyle style, String label, String secondaryLabel, Runnable action, boolean active) {
Button b = new Button(skin.get(ButtonStyle.class));
if (action != null)
b.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
action.run();
}
});
b.setDisabled(!active);
b.add(new Label(label, style)).left();
if (secondaryLabel != null && !secondaryLabel.isEmpty())
b.add(new Label(secondaryLabel, style)).padRight(15f);
table.add(b).minHeight(b.getMinHeight()).prefHeight(b.getPrefHeight()).left().padLeft(1f).colspan(nbColumns);
table.row();
}
项目:ShapeOfThingsThatWere
文件:FramedMenu.java
/**
* Adds a button to the menu, with an icon on the left and label on the right.
*/
public Button addButtonSprite(Drawable icon, String label, Runnable action, boolean active) {
LabelStyle style = active ? skin.get(LabelStyle.class) : skin.get("inactive", LabelStyle.class);
Button b = new Button(skin.get(ButtonStyle.class));
if (action != null)
b.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {
action.run();
}
});
b.setDisabled(!active);
b.add(new Image(icon, Scaling.fit)).left();
Label l = new Label(label, style);
l.setWrap(true);
b.add(l).padLeft(8).right().expandX().fillX();
table.add(b).minHeight(b.getMinHeight()).prefHeight(b.getPrefHeight()).left().padLeft(1f).colspan(nbColumns);
table.row();
return b;
}
项目:bladecoder-adventure-engine
文件:ProjectToolbar.java
private void addToolBarButton(Skin skin, ImageButton button, String icon, String text, String tooltip) {
ImageButtonStyle style = new ImageButtonStyle(skin.get(ButtonStyle.class));
TextureRegion image = Ctx.assetManager.getIcon(icon);
style.imageUp = new TextureRegionDrawable(image);
try {
TextureRegion imageDisabled = Ctx.assetManager.getIcon(icon + "_disabled");
if(imageDisabled != null)
style.imageDisabled = new TextureRegionDrawable(imageDisabled);
} catch (Exception e) {
}
button.setStyle(style);
// button.row();
// button.add(new Label(text, skin));
add(button);
button.setDisabled(true);
TextTooltip t = new TextTooltip(tooltip, skin);
button.addListener(t);
}
项目:bladecoder-adventure-engine
文件:EditToolbar.java
public void addToolBarButton(ImageButton button, String icon, String text, String tooltip) {
TextureRegion image = Ctx.assetManager.getIcon(icon);
TextureRegion imageDisabled = Ctx.assetManager.getIcon(icon + "_disabled");
ImageButtonStyle style = new ImageButtonStyle(skin.get("plain", ButtonStyle.class));
style.imageUp = new TextureRegionDrawable(image);
if(imageDisabled != null)
style.imageDisabled = new TextureRegionDrawable(imageDisabled);
button.setStyle(style);
button.pad(6,3,6,3);
addActor(button);
button.setDisabled(true);
TextTooltip t = new TextTooltip(tooltip, skin);
button.addListener(t);
}
项目:ingress-indonesia-dev
文件:ag.java
ag(v paramv, q paramq)
{
super((Button.ButtonStyle)v.g(paramv).get("inventory-card", Button.ButtonStyle.class));
setWidth(0.6F * v.h(paramv).getWidth());
setHeight(0.57F * v.h(paramv).getHeight());
addListener(new ah(this, paramv, paramq));
v.g(paramv).get("inventory-header", Label.LabelStyle.class);
int i = v.a(v.h(paramv));
switch (aa.b[paramq.a().ordinal()])
{
default:
this.b = new h(paramq, new ad(paramv, paramq), i);
case 1:
case 2:
}
while (true)
{
d();
return;
this.b = new h(paramq, new ak(paramv, paramq), i);
continue;
this.b = new ar(paramq, new ak(paramv, paramq), v.j(paramv), v.k(paramv), v.l(paramv), new ai(this, paramv), i);
}
}
项目:ingress-indonesia-dev
文件:r.java
public final void a(Skin paramSkin, Stage paramStage)
{
this.b = new Table();
this.b.setX(0.0F);
this.b.setY(0.0F);
this.b.setWidth(paramStage.getWidth());
this.b.setHeight(paramStage.getHeight());
this.b.pad(15.0F);
Table localTable = new Table();
ProgressIndicator localProgressIndicator = new ProgressIndicator((ProgressIndicator.ProgressIndicatorStyle)paramSkin.get("ada-wheels-sm", ProgressIndicator.ProgressIndicatorStyle.class));
localProgressIndicator.a(true);
localTable.add(localProgressIndicator).i();
localTable.row();
localTable.add(new Label(this.a, (Label.LabelStyle)paramSkin.get("message-label", Label.LabelStyle.class))).i();
this.c = new Button((Button.ButtonStyle)paramSkin.get("default", Button.ButtonStyle.class));
this.c.setX(paramStage.getWidth());
paramStage.addActor(this.c);
this.b.add(localTable).i();
paramStage.addActor(this.b);
}
项目:ingress-indonesia-dev
文件:AudibleTwoTextButton.java
public final void setStyle(Button.ButtonStyle paramButtonStyle)
{
if (!(paramButtonStyle instanceof AudibleTwoTextButton.TwoTextButtonStyle))
throw new IllegalArgumentException("style must be a TwoTextButtonStyle.");
super.setStyle(paramButtonStyle);
this.c = ((AudibleTwoTextButton.TwoTextButtonStyle)paramButtonStyle);
if (this.a != null)
{
AudibleTwoTextButton.TwoTextButtonStyle localTwoTextButtonStyle2 = (AudibleTwoTextButton.TwoTextButtonStyle)paramButtonStyle;
Label.LabelStyle localLabelStyle2 = this.a.getStyle();
localLabelStyle2.font = localTwoTextButtonStyle2.font;
localLabelStyle2.fontColor = localTwoTextButtonStyle2.fontColor;
this.a.setStyle(localLabelStyle2);
}
if (this.b != null)
{
AudibleTwoTextButton.TwoTextButtonStyle localTwoTextButtonStyle1 = (AudibleTwoTextButton.TwoTextButtonStyle)paramButtonStyle;
Label.LabelStyle localLabelStyle1 = this.b.getStyle();
localLabelStyle1.font = localTwoTextButtonStyle1.font2;
localLabelStyle1.fontColor = localTwoTextButtonStyle1.fontColor2;
this.b.setStyle(localLabelStyle1);
}
}
项目:ingress-indonesia-dev
文件:m.java
public final void b(boolean paramBoolean)
{
boolean bool;
if (a() != paramBoolean)
{
if (paramBoolean)
break label34;
bool = true;
setDisabled(bool);
if (!paramBoolean)
break label39;
}
label34: label39: for (Button.ButtonStyle localButtonStyle = this.c; ; localButtonStyle = this.d)
{
setStyle(localButtonStyle);
return;
bool = false;
break;
}
}
项目:ingress-indonesia-dev
文件:cf.java
public final void a(Skin paramSkin, Stage paramStage)
{
this.k = ((Label.LabelStyle)paramSkin.get("mission-list", Label.LabelStyle.class));
this.l = ((Label.LabelStyle)paramSkin.get("mission-list-disabled", Label.LabelStyle.class));
this.d = ((TextButton.TextButtonStyle)paramSkin.get("mission-list", TextButton.TextButtonStyle.class));
this.e = ((TextButton.TextButtonStyle)paramSkin.get("mission-list-completed", TextButton.TextButtonStyle.class));
this.f = ((TextButton.TextButtonStyle)paramSkin.get("mission-list-selected", TextButton.TextButtonStyle.class));
this.g = ((Button.ButtonStyle)paramSkin.get("default", TextButton.TextButtonStyle.class));
this.h = ((Button.ButtonStyle)paramSkin.get("disabled", Button.ButtonStyle.class));
this.o = paramSkin.getDrawable("nav-button-clear");
this.b = new Table();
this.b.setWidth(paramStage.getWidth());
this.b.setHeight(paramStage.getHeight());
cc.a(this.a, new aa(paramSkin, (int)paramStage.getWidth(), cc.b(this.a), com.nianticproject.ingress.common.ui.widget.ag.c));
this.b.add(cc.c(this.a));
this.b.row();
this.c = new Table();
this.c.setWidth(-10 + (int)paramStage.getWidth());
ScrollPane localScrollPane = new ScrollPane(this.c, new ScrollPane.ScrollPaneStyle());
localScrollPane.setScrollY(0.0F);
localScrollPane.setScrollingDisabled(true, false);
this.b.add(localScrollPane).g().o().p().j().a(5.0F, 5.0F, 5.0F, 5.0F);
paramStage.addActor(this.b);
}
项目:OdysseeDesMaths
文件:MiniGameUI.java
/**
* Ajoute un bouton d'action "A" à l'interface.
*/
public void addButtonA() {
useButtonA = true;
ButtonStyle buttonStyle = new ButtonStyle();
buttonStyle.up = skin.getDrawable("button");
buttonStyle.down = skin.getDrawable("button_pressed");
skin.add("buttonA", buttonStyle);
buttonA = new Button(skin, "buttonA");
buttonAContainer.setActor(buttonA);
buttonAContainer.size(64, 64);
}
项目:OdysseeDesMaths
文件:MiniGameUI.java
/**
* Ajoute un bouton d'action "B" à l'interface.
*/
public void addButtonB() {
useButtonB = true;
ButtonStyle buttonStyle = new ButtonStyle();
buttonStyle.up = skin.getDrawable("button");
buttonStyle.down = skin.getDrawable("button_pressed");
skin.add("buttonB", buttonStyle);
buttonB = new Button(skin, "buttonB");
buttonBContainer.setActor(buttonB);
buttonBContainer.size(64, 64).padLeft(20);
}
项目:OdysseeDesMaths
文件:AudioButtons.java
public AudioButtons() {
skin = new Skin();
skin.addRegions(Assets.getManager().get(Assets.UI_MAIN, TextureAtlas.class));
ButtonStyle musicButtonStyle = new ButtonStyle();
if (OdysseeDesMaths.getSettings().isMusicMuted()) {
musicButtonStyle.up = skin.getDrawable("music_off");
} else {
musicButtonStyle.up = skin.getDrawable("music_on");
}
skin.add("music", musicButtonStyle);
ButtonStyle soundsButtonStyle = new ButtonStyle();
if (OdysseeDesMaths.getSettings().areEffectsMuted()) {
soundsButtonStyle.up = skin.getDrawable("sounds_off");
} else {
soundsButtonStyle.up = skin.getDrawable("sounds_on");
}
skin.add("sounds", soundsButtonStyle);
music = new Button(skin, "music");
sounds = new Button(skin, "sounds");
add(music);
add(sounds);
AudioButtonsListener listener = new AudioButtonsListener();
music.addListener(listener);
sounds.addListener(listener);
}
项目:bladecoder-adventure-engine
文件:LoadSaveScreen.java
/**
* Creates a button to represent one slot
*
* @param slot
* @return The button to use for one slot
*/
private Button getSlotButton(String slot) {
final Skin skin = ui.getSkin();
final Button button = new Button(new ButtonStyle());
final ButtonStyle style = button.getStyle();
style.up = style.down = skin.getDrawable("black");
String textLabel = I18N.getString("ui.newSlot");
button.setSize(slotWidth, slotHeight);
if (slotExists(slot)) {
button.add(getScreenshot(slot)).maxSize(slotWidth * .95f, slotHeight * .95f);
try {
long l = Long.parseLong(slot);
Date d = new Date(l);
textLabel = (new SimpleDateFormat()).format(d);
} catch (Exception e) {
textLabel = slot;
}
button.addListener(loadClickListener);
} else {
Image fg = new Image(skin.getDrawable("plus"));
button.add(fg).maxSize(slotHeight / 2, slotHeight / 2);
button.addListener(saveClickListener);
}
button.row();
Label label = new Label(textLabel, skin);
label.setAlignment(Align.center);
button.add(label).fillX();
button.setName(slot);
return button;
}
项目:nahwc-g
文件:MainMenuInterface.java
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);
}
项目:ead
文件:Spinner.java
public void setStyle(SpinnerStyle style) {
ButtonStyle plusStyle = plusButton.getStyle();
plusStyle.up = style.plusUp;
plusStyle.down = style.plusDown;
ButtonStyle minusStyle = minusButton.getStyle();
minusStyle.up = style.minusUp;
minusStyle.down = style.minusDown;
textField.setStyle(style);
}
项目:ead
文件:ButtonProcessor.java
@Override
public Component getComponent(Button component) {
Skin skin = gameAssets.getSkin();
ControlComponent button = gameLoop
.createComponent(ControlComponent.class);
button.setControl(new com.badlogic.gdx.scenes.scene2d.ui.Button(
new ButtonStyle(skin.get(component.getStyle(),
ButtonStyle.class))));
return button;
}
项目:ead
文件:WidgetBuilder.java
public static ImageButton circleButton(String icon) {
ButtonStyle circleStyle = skin.get(SkinConstants.STYLE_CIRCLE,
ButtonStyle.class);
ImageButtonStyle imageButtonStyle = new ImageButtonStyle(circleStyle);
imageButtonStyle.imageUp = skin.getDrawable(icon);
ImageButton imageButton = new ImageButton(imageButtonStyle);
imageButton.setName(icon);
return imageButton;
}
项目:ead
文件:SearchWidget.java
public SearchWidget(Skin skin) {
super(true);
SearchWidgetStyle style = skin.get(SearchWidgetStyle.class);
background(style.background);
label = new Label("", new LabelStyle(style.font, style.fontColor));
ImageButtonStyle buttonStyle = new ImageButtonStyle(
skin.get(ButtonStyle.class));
buttonStyle.imageUp = style.searchIcon;
searchButton = new ImageButton(buttonStyle);
add(label).expand(true, true);
add(searchButton);
}
项目:ingress-indonesia-dev
文件:ActionButton$ActionButtonStyle.java
public ActionButton$ActionButtonStyle(Label.LabelStyle paramLabelStyle1, Label.LabelStyle paramLabelStyle2, Label.LabelStyle paramLabelStyle3, Label.LabelStyle paramLabelStyle4, Label.LabelStyle paramLabelStyle5, Color paramColor, Button.ButtonStyle paramButtonStyle1, Button.ButtonStyle paramButtonStyle2)
{
this.mainLabelStyle = paramLabelStyle1;
this.subLabelStyle = paramLabelStyle2;
this.mainDisabledLabelStyle = paramLabelStyle3;
this.subDisabledLabelStyle = paramLabelStyle4;
this.errorLabelStyle = paramLabelStyle5;
this.enabledButtonStyle = paramButtonStyle1;
this.disabledButtonStyle = paramButtonStyle2;
}
项目:ingress-indonesia-dev
文件:as.java
public as(at paramat, Skin paramSkin, Stage paramStage, boolean paramBoolean, com.nianticproject.ingress.common.h.l paraml, com.nianticproject.ingress.common.j.as paramas)
{
this.c = paramat;
this.d = paramSkin;
this.e = paramStage;
this.f = paramBoolean;
this.g = paraml;
this.p = p.a().k();
this.o = new s(this.p.n());
this.o.a(Color.CLEAR);
this.o.b(paramSkin.getColor("ochre-line"));
this.o.b(0.03F);
this.o.a(paramas);
this.h = new Label.LabelStyle((Label.LabelStyle)paramSkin.get("owner-tag", Label.LabelStyle.class));
this.h.background = c.a(paramSkin, new Color(1.0F, 1.0F, 1.0F, 0.7F));
this.k = new Button.ButtonStyle(new TextureRegionDrawable(com.nianticproject.ingress.common.gameentity.g.b.findRegion("hex-button-up")), new TextureRegionDrawable(com.nianticproject.ingress.common.gameentity.g.b.findRegion("hex-button-down")), new TextureRegionDrawable(com.nianticproject.ingress.common.gameentity.g.b.findRegion("hex-button-checked")));
this.m = ((Label.LabelStyle)paramSkin.get("tiny", Label.LabelStyle.class));
this.n = ((Label.LabelStyle)paramSkin.get("large", Label.LabelStyle.class));
for (r localr : r.values())
{
this.j[localr.a()] = new av(this, localr);
addActor(this.j[localr.a()].c);
}
this.l = new Image(paramSkin.getDrawable("reddot"));
this.l.setTouchable(Touchable.disabled);
addActor(this.l);
this.a = (0.7853981633974483D * Math.round(p.a().k().w() / 0.7853981633974483D));
}
项目:ingress-indonesia-dev
文件:q.java
public q(m paramm, Skin paramSkin, Table paramTable, Stage paramStage)
{
super((Button.ButtonStyle)paramSkin.get("portal-key-chooser-handle", TextButton.TextButtonStyle.class));
this.b = paramTable;
Table localTable = new Table();
localTable.setBackground(paramSkin.getDrawable("portal-key-vert"));
add(localTable).i();
this.d = paramStage.getWidth();
this.e = 0.0F;
addListener(this.g);
}
项目:ingress-indonesia-dev
文件:c.java
public final void clicked(InputEvent paramInputEvent, float paramFloat1, float paramFloat2)
{
o.a().a(bs.aO);
this.c.a.c();
if (this.c.a.b());
for (String str = "audio-pause"; ; str = "audio-play")
{
this.a.setStyle((Button.ButtonStyle)this.b.get(str, ImageButton.ImageButtonStyle.class));
return;
}
}
项目:ingress-indonesia-dev
文件:cw.java
public final void a(Skin paramSkin, Stage paramStage)
{
super.a(paramSkin, paramStage);
this.l = new Image();
this.l.setAlign(1);
this.l.setScaling(Scaling.fill);
this.m = new Image(paramSkin, "hud-arrow");
this.m.setAlign(1);
this.m.setScaling(Scaling.fit);
this.m.setHeight(0.024F * paramStage.getHeight());
float f = 0.95F * v.a(paramStage);
this.n = new ProgressIndicator(paramSkin);
this.n.a(true);
this.i = new Label(" ", paramSkin, "default-font", "yellow");
this.j = new Label("L1", paramSkin, "default-font", "white");
this.k = new Label(" PORTAL", paramSkin, "x-small-font", "white");
this.i.setAlignment(1);
this.e.clear();
Table localTable1 = new Table();
Table localTable2 = new Table();
localTable2.add(this.j).a(Integer.valueOf(8));
localTable2.add(this.k).a(Integer.valueOf(8));
localTable1.add(localTable2);
localTable1.row();
localTable1.add(this.i).a(Integer.valueOf(8));
this.e.add(localTable1).g(5.0F).a(Integer.valueOf(2));
f localf = this.e;
Actor[] arrayOfActor = new Actor[2];
arrayOfActor[0] = this.n;
arrayOfActor[1] = this.l;
localf.stack(arrayOfActor).b(f).c(f).g(5.0F);
this.g.put(ai.b, paramSkin.get("portal-vector-aliens", TextButton.TextButtonStyle.class));
this.g.put(ai.a, paramSkin.get("portal-vector-resistance", TextButton.TextButtonStyle.class));
this.g.put(ai.c, paramSkin.get("portal-vector-neutral", TextButton.TextButtonStyle.class));
this.h.put(ai.b, paramSkin.get("aliens", Color.class));
this.h.put(ai.a, paramSkin.get("resistance", Color.class));
this.h.put(ai.c, paramSkin.get("neutral", Color.class));
this.f.setStyle((Button.ButtonStyle)paramSkin.get("portal-vector-target", TextButton.TextButtonStyle.class));
}
项目:skin-composer
文件:StyleData.java
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;
}
}
项目:skin-composer
文件:Spinner.java
public SpinnerStyle(ButtonStyle buttonMinusStyle, ButtonStyle buttonPlusStyle, TextFieldStyle textFieldStyle) {
this.buttonMinusStyle = buttonMinusStyle;
this.buttonPlusStyle = buttonPlusStyle;
this.textFieldStyle = textFieldStyle;
}
项目:OdysseeDesMaths
文件:NewSave.java
public NewSave(OdysseeDesMaths game) {
this.game = game;
viewport = new StretchViewport(WIDTH, HEIGHT);
stage = new Stage(viewport);
Gdx.input.setInputProcessor(stage);
table = new Table();
table.setFillParent(true);
stage.addActor(table);
skin = new Skin();
skin.addRegions(Assets.getManager().get(Assets.UI_MAIN, TextureAtlas.class));
skin.addRegions(Assets.getManager().get(Assets.UI_ORANGE, TextureAtlas.class));
skin.add("background", Assets.getManager().get(Assets.MAIN_MENU_BACKGROUND, Texture.class));
skin.add("title", new LabelStyle(TITLE, null));
skin.add("text", new LabelStyle(TEXT, null));
TextButtonStyle textButtonStyle = new TextButtonStyle();
textButtonStyle.font = TEXT;
textButtonStyle.up = skin.getDrawable("button");
textButtonStyle.down = skin.getDrawable("button_pressed");
skin.add("textButton", textButtonStyle);
TextFieldStyle textFieldStyle = new TextFieldStyle();
textFieldStyle.font = TEXT;
textFieldStyle.fontColor = Color.BLACK;
textFieldStyle.background = skin.getDrawable("field");
textFieldStyle.focusedBackground = skin.getDrawable("field_focused");
skin.add("textField", textFieldStyle);
ButtonStyle returnButtonStyle = new ButtonStyle();
returnButtonStyle.up = skin.getDrawable("return");
skin.add("returnButton", returnButtonStyle);
gameTitle = new Label("L'Odyssée des Maths", skin, "title");
saveNameLabel = new Label("Nom:", skin, "text");
saveNameField = new TextField("", skin, "textField");
saveNameField.setMaxLength(7);
submit = new TextButton("C'est parti !", skin, "textButton");
audioButtons = new AudioButtons();
returnButton = new Button(skin, "returnButton");
table.setBackground(skin.getDrawable("background"));
table.padTop(HEIGHT / 13);
table.add(gameTitle).top().colspan(2).padBottom(HEIGHT / 9).expandX();
table.row().padBottom(HEIGHT / 10);
table.add(saveNameLabel).right().padRight(10);
table.add(saveNameField).size(200, 48).left();
table.row();
table.add(submit).size(350, 64).top().colspan(2).expandY();
table.row();
table.add(audioButtons).left();
table.add(returnButton).right();
NewSaveListener listener = new NewSaveListener();
submit.addListener(listener);
returnButton.addListener(listener);
noNameSubmitAction = new ColorAction();
noNameSubmitAction.setEndColor(Color.WHITE);
noNameSubmitAction.setDuration(0.5f);
}
项目:Vloxlands
文件:Human.java
@Override
public void setUI(final PinnableWindow window, Object... params) {
window.row().pad(0).colspan(50).padRight(-10).fillX();
final List<Job> jobs = new List<Job>(Vloxlands.skin);
jobs.setItems(new IdleJob(this));
jobs.addAction(new Action() {
@Override
public boolean act(float delta) {
if (jobQueue.size == 0 && jobs.getItems().get(0) instanceof IdleJob) return false;
if (!jobQueue.equals(jobs.getItems())) {
if (jobQueue.size > 0) jobs.setItems(jobQueue);
else jobs.setItems(new IdleJob(Human.this));
jobs.getSelection().setDisabled(true);
jobs.setSelectedIndex(-1);
window.pack();
}
return false;
}
});
jobs.getSelection().setDisabled(true);
jobs.setSelectedIndex(-1);
jobs.getStyle().selection.setLeftWidth(10);
jobs.getStyle().selection.setTopHeight(3);
final ScrollPane jobsWrap = new ScrollPane(jobs, Vloxlands.skin);
jobsWrap.setVisible(false);
jobsWrap.setScrollbarsOnTop(false);
jobsWrap.setFadeScrollBars(false);
final Cell<?> cell = window.add(jobsWrap).height(0);
window.row();
ItemSlot tool = new ItemSlot(window.getStage(), this.tool);
window.left().add(tool).spaceRight(2);
ItemSlot slot = new ItemSlot(window.getStage(), carryingItemStack);
window.add(slot).spaceRight(2);
ItemSlot armor = new ItemSlot(window.getStage(), new ItemStack());
window.add(armor).spaceRight(2);
ImageButtonStyle style = new ImageButtonStyle(Vloxlands.skin.get("image_toggle", ButtonStyle.class));
style.imageUp = Vloxlands.skin.getDrawable("queue");
style.imageUp.setMinWidth(ItemSlot.size);
style.imageUp.setMinHeight(ItemSlot.size);
style.imageDown = Vloxlands.skin.getDrawable("queue");
style.imageDown.setMinWidth(ItemSlot.size);
style.imageDown.setMinHeight(ItemSlot.size);
final TooltipImageButton job = new TooltipImageButton(style);
window.getStage().addActor(job.getTooltip());
job.setName("job");
ClickListener cl = new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
cell.height(cell.getMinHeight() == 100 ? 0 : 100);
jobsWrap.setVisible(!jobsWrap.isVisible());
window.invalidateHierarchy();
window.pack();
}
};
job.addListener(cl);
job.getTooltip().set("Job Queue", "Toggle Job Queue display");
window.add(job).padRight(-10);
if (params[0] == Boolean.TRUE) {
job.setChecked(true);
cl.clicked(null, 0, 0);
}
}
项目:ead
文件:WidgetBuilder.java
public static ImageButton imageButton(String icon, String buttonStyle) {
ButtonStyle style = skin.get(buttonStyle, ButtonStyle.class);
ImageButtonStyle imageButtonStyle = new ImageButtonStyle(style);
imageButtonStyle.imageUp = skin.getDrawable(icon);
return new ImageButton(imageButtonStyle);
}
项目:acid-snake
文件:IngameScreen.java
@Override
public void resize(int width, int height) {
if (stage == null) {
stage = new IngameProcessor(width, height, game, world);
Gdx.input.setInputProcessor(stage);
LabelStyle popupStyle = new LabelStyle();
popupStyle.font = Resources.BITMAP_FONT_REGULAR;
popupStyle.fontColor = Resources.COLOR_GREEN;
LabelStyle style = new LabelStyle();
style.font = Resources.BITMAP_FONT_LARGE;
style.fontColor = Resources.COLOR_GREEN;
LabelStyle styleLevel = new LabelStyle();
styleLevel.font = Resources.BITMAP_FONT_LARGE;
styleLevel.fontColor = Resources.COLOR_VIOLET;
ButtonStyle pauseStyle = new ButtonStyle();
pauseStyle.up = new SpriteDrawable(new Sprite(Resources.TEXTURE_ICON_PAUSE));
pauseStyle.checked = new SpriteDrawable(new Sprite(Resources.TEXTURE_ICON_PLAY));
btnPause = new PauseButton(world, pauseStyle);
stage.addActor(btnPause);
lblScore = new ScoreLabel(world.getPlayer(), tweenManager, style);
lblLevel = new LevelLabel(world.getPlayer(), tweenManager, styleLevel);
stage.addActor(lblScore);
stage.addActor(lblLevel);
applyUI();
popupManager = new PopupManager(stage, tweenManager, popupStyle);
PointManager pointManager = new PointManager(acid, popupManager);
achievementManager.addListener(pointManager);
Snake snake = world.getSnake();
snake.addListener(pointManager);
progressImage = new ProgressImage(world.getPlayer());
stage.addActor(progressImage);
PlayerActorAnimator animator = new PlayerActorAnimator(progressImage, tweenManager);
world.getPlayer().addListener(animator);
} else {
stage.setViewport(width, height, false);
applyUI();
}
}
项目:explosions
文件:LevelSelectron.java
private Button getLevelButton(int level) {
//Create a basic button style that doesn't have any images
ButtonStyle buttonStyle = new ButtonStyle();
Button button = new Button(buttonStyle);
levelButtonMap.put(level, button);
// Create the label to show the level number
LabelStyle labelStyleActive = skin.get("levelButtons", LabelStyle.class);
labelStyleActive.font = font;
Label label = new Label(Integer.toString(level + 1), labelStyleActive);
label.setAlignment(Align.center);
// Stack the image label on top of eachother
Image buttonImage = new Image(buttonTexture);
button.stack(buttonImage, label).size(64f, 64f);
//set button properties for an active button
if (level <= levelsUnlocked) {
buttonStyle.pressedOffsetX = 1;
buttonStyle.pressedOffsetY = -1;
buttonImage.setColor(ColorUtils.getRandomHSBColor());
//assign a name to the actor based on the level it represents
button.setName(Integer.toString(level));
button.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
setSelectedLevel(Integer.parseInt(event.getListenerActor().getName()));
}
});
button.addListener(buttonListener);
//calculate "star" information
final LevelInfo levelData = LevelInfo.getLevelInfo(level);
float maxDiff = levelData.numTotal - levelData.numNeededToPass;
float earnedDiff = SaveData.getLevelScore(level) - levelData.numNeededToPass;
float perCent = earnedDiff / maxDiff;
int stars = 0;
if (perCent <= 0.20f) {
stars = 1;
} else if (perCent <= 0.60f) {
stars = 2;
} else {
stars = 3;
}
Table starTable = new Table();
starTable.defaults().pad(2f);
if (stars >= 1) {
for (int star = 0; star < MAX_STARS; star++) {
Image image = new Image((stars > star) ? buttonTexture : hollowTexture);
image.setColor(buttonImage.getColor());
starTable.add(image).width(16f).height(16f);
}
}
button.row();
button.add(starTable).height(25f);
} else if (level <= LevelInfo.getNumberOfLevels() - 1) {
buttonImage.setColor(new Color(0.75f, 0.75f, 0.75f, 1)); //existing levels, but are locked
} else { //levels that don't exist that are used for keeping the layout, make them invisible
button.getColor().a = 0f;
}
return button;
}
项目:ingress-indonesia-dev
文件:l.java
public static Button.ButtonStyle a(Skin paramSkin, boolean paramBoolean)
{
if (paramBoolean);
for (String str = "owned-item-outline"; ; str = "item-outline")
return (Button.ButtonStyle)paramSkin.get(str, Button.ButtonStyle.class);
}
项目:ingress-indonesia-dev
文件:d.java
public d(Actor paramActor, Button.ButtonStyle paramButtonStyle)
{
super(paramActor, paramButtonStyle);
a(this);
}
项目:ingress-indonesia-dev
文件:d.java
public d(Button.ButtonStyle paramButtonStyle)
{
super(paramButtonStyle);
a(this);
}
项目:ingress-indonesia-dev
文件:x.java
public x(Actor paramActor1, Actor paramActor2, Button.ButtonStyle paramButtonStyle1, Button.ButtonStyle paramButtonStyle2)
{
super(paramActor1, paramActor2, paramButtonStyle1, paramButtonStyle2);
addListener(new y(this, this));
}
项目:ingress-indonesia-dev
文件:m.java
public m(Actor paramActor1, Actor paramActor2, Button.ButtonStyle paramButtonStyle1, Button.ButtonStyle paramButtonStyle2)
{
}
项目:ingress-indonesia-dev
文件:j.java
public static Button.ButtonStyle a(Skin paramSkin, n paramn)
{
if (paramn == null);
for (String str = "inventory-card"; ; str = "inventory-card-disabled")
return (Button.ButtonStyle)paramSkin.get(str, Button.ButtonStyle.class);
}
项目:ingress-indonesia-dev
文件:d.java
public final void clicked(InputEvent paramInputEvent, float paramFloat1, float paramFloat2)
{
o.a().a(bs.aO);
this.c.a.d();
this.a.setStyle((Button.ButtonStyle)this.b.get("audio-pause", ImageButton.ImageButtonStyle.class));
}
项目:ingress-indonesia-dev
文件:aw.java
private void f()
{
Portal localPortal = (Portal)at.b(this.f).getComponent(Portal.class);
boolean bool = localPortal.canTeamLinkMods(at.d(this.f).h());
float f1 = 0.008F * Gdx.graphics.getHeight();
this.h = ((Button.ButtonStyle)this.g.get("item-outline", Button.ButtonStyle.class));
this.i = ((Button.ButtonStyle)this.g.get("item-disabled", Button.ButtonStyle.class));
Color localColor = ea.a(b.a(at.b(this.f)));
int i1 = 0;
if (i1 < this.j.length)
{
Mod localMod = localPortal.getLinkedMod(i1);
Button localButton = this.j[i1];
localButton.removeListener(this.m[i1]);
Button.ButtonStyle localButtonStyle;
if (localMod == null)
if (bool)
{
localButtonStyle = this.h;
label164: localButton.clear();
localButton.add(g.a()).g(f1);
localButton.setStyle(localButtonStyle);
ax localax = new ax(this, bool, i1);
this.m[i1] = localax;
localButton.addListener(localax);
this.k[i1].addAction(Actions.fadeOut(0.5F));
label235: if (this.o != i1)
break label477;
this.l[i1].clearActions();
this.l[i1].addAction(Actions.fadeIn(0.25F));
}
while (true)
{
i1++;
break;
localButtonStyle = this.i;
break label164;
Drawable localDrawable = g.a(localMod.buildModResource().getResourceType(), localMod.getRarity());
localButton.clear();
localButton.add(new Image(localDrawable, Scaling.fit)).n().f().g(com.nianticproject.ingress.common.w.l.a(1.0F));
localButton.setStyle(com.nianticproject.ingress.common.ui.l.a(this.g, true));
ay localay = new ay(this, i1);
this.m[i1] = localay;
localButton.addListener(localay);
this.k[i1].a(localMod.getInstallingUser());
float f2 = this.k[i1].getColor().a;
this.k[i1].getColor().set(localColor.r, localColor.g, localColor.b, f2);
this.k[i1].clearActions();
this.k[i1].addAction(Actions.fadeIn(0.5F));
break label235;
label477: this.l[i1].clearActions();
this.l[i1].addAction(Actions.fadeOut(0.5F));
}
}
}