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


Java ButtonStyle类代码示例

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


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

示例1: Map

import com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle; //导入依赖的package包/类
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);
}
 
开发者ID:mganzarcik,项目名称:fabulae,代码行数:26,代码来源:Map.java

示例2: createFormationButton

import com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle; //导入依赖的package包/类
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;
	}
 
开发者ID:libgdx-jam,项目名称:GDXJam,代码行数:17,代码来源:FormationPatternTable.java

示例3: addButton

import com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle; //导入依赖的package包/类
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();
}
 
开发者ID:guillaume-alvarez,项目名称:ShapeOfThingsThatWere,代码行数:19,代码来源:FramedMenu.java

示例4: addButtonSprite

import com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:guillaume-alvarez,项目名称:ShapeOfThingsThatWere,代码行数:27,代码来源:FramedMenu.java

示例5: addToolBarButton

import com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle; //导入依赖的package包/类
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);
}
 
开发者ID:bladecoder,项目名称:bladecoder-adventure-engine,代码行数:24,代码来源:ProjectToolbar.java

示例6: addToolBarButton

import com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle; //导入依赖的package包/类
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);
}
 
开发者ID:bladecoder,项目名称:bladecoder-adventure-engine,代码行数:18,代码来源:EditToolbar.java

示例7: ag

import com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle; //导入依赖的package包/类
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);
  }
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:25,代码来源:ag.java

示例8: a

import com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle; //导入依赖的package包/类
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);
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:21,代码来源:r.java

示例9: setStyle

import com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle; //导入依赖的package包/类
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);
  }
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:24,代码来源:AudibleTwoTextButton.java

示例10: b

import com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle; //导入依赖的package包/类
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;
  }
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:21,代码来源:m.java

示例11: a

import com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle; //导入依赖的package包/类
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);
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:25,代码来源:cf.java

示例12: addButtonA

import com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:naomiHauret,项目名称:OdysseeDesMaths,代码行数:16,代码来源:MiniGameUI.java

示例13: addButtonB

import com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:naomiHauret,项目名称:OdysseeDesMaths,代码行数:17,代码来源:MiniGameUI.java

示例14: AudioButtons

import com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle; //导入依赖的package包/类
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);
}
 
开发者ID:naomiHauret,项目名称:OdysseeDesMaths,代码行数:31,代码来源:AudioButtons.java

示例15: getSlotButton

import com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:bladecoder,项目名称:bladecoder-adventure-engine,代码行数:46,代码来源:LoadSaveScreen.java


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