예제 #1
0
 public void setStyle(Style style) {
   this.style = style;
   // window
   window.setBackground(style.background);
   window.pad(style.vPad, style.hPad, style.vPad, style.hPad);
   // title
   title.setStyle(style.title);
   // action buttons
   actionsGroup.setStyle(style.actionsGroup);
 }
예제 #2
0
  // constructors -------------------------------------------------------------------------
  public MenuScreen() {
    stage = new Stage(new ExtendViewport(screenWidth, screenHeight));

    // loads the assets
    Resources.loadMainMenu(highDef);
    Resources.manager.finishLoading();
    menuSkin =
        Resources.manager.get(
            (highDef ? "skins/mainMenuHigh.json" : "skins/mainMenu.json"), Skin.class);

    // creates the table
    table = new Table();
    table.setSkin(menuSkin);
    table.setBackground("uiBackground");
  }
예제 #3
0
  public MenuBar(MenuBarStyle style) {
    menuItems = new VisTable();

    mainTable =
        new VisTable() {
          @Override
          protected void sizeChanged() {
            super.sizeChanged();
            closeMenu();
          }
        };

    mainTable.left();
    mainTable.add(menuItems);
    mainTable.setBackground(style.background);
  }
예제 #4
0
  public AlertDialog(String titleText, Style style) {
    this.style = style;
    //        debug();

    setFillParent(true);
    setVisible(false);

    window = new Table();
    //        window.debug();
    window.setBackground(style.background);
    window.pad(style.vPad, style.hPad, style.vPad, style.hPad);

    // title
    title = new Label(titleText, style.title);
    window.add(title);
    window.row();

    add(window);
    row();

    actionsGroup = new DialogActionsGroup(style.actionsGroup);
    add(actionsGroup).center();
  }
예제 #5
0
  public OptionScreen(Anvil anvil) {
    super(anvil);

    Skin skin = new Skin(Gdx.files.internal(Systems.Skin));

    back = new Texture(Gdx.files.internal(Locale.SYSTEM_UI_PATH + "marble.png"));
    background = new Image(back);

    FreeTypeFontGenerator gen =
        new FreeTypeFontGenerator(Gdx.files.internal(Locale.FONT_BASE + "Canted Comic.ttf"));
    FreeTypeFontParameter par = new FreeTypeFontParameter();
    par.size = 20;
    par.borderColor = Color.BLACK;
    par.color = Color.WHITE;
    par.borderWidth = 2;
    BitmapFont font = gen.generateFont(par);

    LabelStyle ls = new LabelStyle();
    ls.font = font;

    CheckBox vsync = new CheckBox("VSync", skin);
    vsync.setChecked(getBool("Graphics", "useVsync"));
    vsync.addListener(
        new ClickListener() {
          @Override
          public void clicked(InputEvent event, float x, float y) {
            bVsync = vsync.isChecked();
            vsync.setChecked(vsync.isChecked() ? false : true);
          }
        });

    Separator sep = new Separator();

    CheckBox controller = new CheckBox("Use Controller", skin);
    controller.setChecked(getBool("Controls", "useController"));
    controller.addListener(
        new ClickListener() {
          public void clicked(InputEvent event, float x, float y) {}
        });

    TextButton okay = new TextButton("Apply", skin);
    okay.addListener(
        new ClickListener() {
          @Override
          public void clicked(InputEvent event, float x, float y) {
            save();
            anvil.setScreen(new MenuScreen(anvil));
          }
        });

    Table opt = new Table(skin);
    opt.setFillParent(true);
    opt.setBackground(background.getDrawable());

    opt.add(new Label("Graphics", ls)).row();
    opt.add(sep);
    opt.add(vsync).row();
    opt.add().row();
    opt.add().row();
    opt.add().row();

    opt.add(okay).align(Align.bottomLeft);

    stage.addActor(opt);
    Gdx.input.setInputProcessor(stage);
  }
예제 #6
0
  @Override
  public void show() {
    super.show();

    backgroundStage.addActor(new Image(atlas.findRegion("background")));

    Image alien = new Image(atlas.findRegion("alien"));
    alien.setPosition(mainStage.getWidth() + mainStage.getPadLeft(), -365f);
    mainStage.addActor(alien);

    Image energy = new Image(atlas.findRegion("energy")); // 195, 313
    energy.setPosition(83f, 201f);
    energy.setScale(0f);
    energy.setOrigin(energy.getPrefWidth() / 2, energy.getPrefHeight() / 2);
    mainStage.addActor(energy);

    final Table certificateTable = new Table();
    certificateTable.padTop(314f).padBottom(101f).defaults().padBottom(100f);
    certificateTable.setBackground(new TextureRegionDrawable(atlas.findRegion("certificate")));
    certificateTable.setSize(mainStage.getWidth(), mainStage.getHeight());
    certificateTable.setOrigin(195f, 313f);
    certificateTable.setTransform(true);
    certificateTable.setTouchable(Touchable.disabled);
    certificateTable.addListener(
        new ClickListener() {
          @Override
          public void clicked(InputEvent event, float x, float y) {
            Assets.fanfareFX.stop();
            game.loadNextScreen(EndingScreen.this, KonnectingGame.ScreenType.MAIN_MENU);
          }
        });
    certificateTable.setScale(0f);
    mainStage.addActor(certificateTable);

    StatsData tempData = SavedData.getStats();
    int score =
        tempData.kronosScore1
            + tempData.kronosScore2
            + tempData.kronosScore3
            + tempData.kronosScore4
            + tempData.kronosScore5
            + tempData.kronosScore6
            + tempData.kronosScore7
            + tempData.zappingScore1
            + tempData.zappingScore2
            + tempData.zappingScore3
            + tempData.zappingScore4
            + tempData.zappingScore5;

    final Label userLabel =
        new Label(
            SavedData.getUsername() + "\n\n" + score + "pt",
            new Label.LabelStyle(uiSkin.getFont("default-font"), Color.WHITE));
    userLabel.setWrap(true);
    userLabel.setAlignment(Align.center);
    userLabel.getColor().a = 0f;
    certificateTable.add(userLabel).width(407f).row();

    String correctComment = comments[0];
    for (int i = scoreLimits.length - 1; i >= 0; i--) {
      if (score > scoreLimits[i]) {
        correctComment = comments[i];
        break;
      }
    }
    final Label commentLabel =
        new Label(correctComment, new Label.LabelStyle(uiSkin.getFont("arial"), Color.WHITE));
    commentLabel.setWrap(true);
    commentLabel.setFontScale(0.9f);
    commentLabel.setAlignment(Align.center);
    commentLabel.getColor().a = 0f;
    certificateTable.add(commentLabel).width(407f);

    Timeline.createSequence()
        .push(Tween.to(alien, ActorAccessor.MOVE_X, 1f).target(20f))
        .pushPause(0.25f)
        .push(Tween.to(energy, ActorAccessor.SCALEXY, 1f).target(1f))
        .push(Tween.to(energy, ActorAccessor.SCALEXY, 0.5f).target(0.8f))
        .push(Tween.to(energy, ActorAccessor.SCALEXY, 0.5f).target(1f))
        .push(Tween.to(certificateTable, ActorAccessor.SCALEXY, 0.5f).target(1f))
        .beginParallel()
        .push(Tween.to(userLabel, ActorAccessor.ALPHA, 0.5f).target(1f))
        .push(Tween.to(commentLabel, ActorAccessor.ALPHA, 0.5f).target(1f))
        .end()
        .setCallback(
            new TweenCallback() {
              @Override
              public void onEvent(int type, BaseTween<?> source) {
                Assets.fanfareFX.setOnCompletionListener(
                    new Music.OnCompletionListener() {
                      @Override
                      public void onCompletion(Music music) {
                        Assets.fanfareFX.setOnCompletionListener(null);
                        certificateTable.setTouchable(Touchable.enabled);
                      }
                    });
                Assets.fanfareFX.play();
              }
            })
        .start(tweenManager);
  }
예제 #7
0
파일: Table.java 프로젝트: ngdelamo/libgdx
 /**
  * Sets the background drawable from the skin. This may only be called if {@link
  * Table#Table(Skin)} or {@link #setSkin(Skin)} was used.
  */
 public void setBackground(String drawableName) {
   setBackground(skin.getDrawable(drawableName));
 }
예제 #8
0
  public InventoryUI() {
    super("Inventory", Utility.STATUSUI_SKIN, "solidbackground");

    _observers = new Array<InventoryObserver>();

    _dragAndDrop = new DragAndDrop();
    _inventoryActors = new Array<Actor>();

    // create
    _inventorySlotTable = new Table();
    _inventorySlotTable.setName("Inventory_Slot_Table");

    _playerSlotsTable = new Table();
    _equipSlots = new Table();
    _equipSlots.setName("Equipment_Slot_Table");

    _equipSlots.defaults().space(10);
    _inventorySlotTooltip = new InventorySlotTooltip(Utility.STATUSUI_SKIN);

    Label DPLabel = new Label("Defense: ", Utility.STATUSUI_SKIN);
    _DPValLabel = new Label(String.valueOf(_DPVal), Utility.STATUSUI_SKIN);

    Label APLabel = new Label("Attack : ", Utility.STATUSUI_SKIN);
    _APValLabel = new Label(String.valueOf(_APVal), Utility.STATUSUI_SKIN);

    Table labelTable = new Table();
    labelTable.add(DPLabel).align(Align.left);
    labelTable.add(_DPValLabel).align(Align.center);
    labelTable.row();
    labelTable.row();
    labelTable.add(APLabel).align(Align.left);
    labelTable.add(_APValLabel).align(Align.center);

    InventorySlot headSlot =
        new InventorySlot(
            ItemUseType.ARMOR_HELMET.getValue(),
            new Image(Utility.ITEMS_TEXTUREATLAS.findRegion("inv_helmet")));

    InventorySlot leftArmSlot =
        new InventorySlot(
            ItemUseType.WEAPON_ONEHAND.getValue()
                | ItemUseType.WEAPON_TWOHAND.getValue()
                | ItemUseType.ARMOR_SHIELD.getValue()
                | ItemUseType.WAND_ONEHAND.getValue()
                | ItemUseType.WAND_TWOHAND.getValue(),
            new Image(Utility.ITEMS_TEXTUREATLAS.findRegion("inv_weapon")));

    InventorySlot rightArmSlot =
        new InventorySlot(
            ItemUseType.WEAPON_ONEHAND.getValue()
                | ItemUseType.WEAPON_TWOHAND.getValue()
                | ItemUseType.ARMOR_SHIELD.getValue()
                | ItemUseType.WAND_ONEHAND.getValue()
                | ItemUseType.WAND_TWOHAND.getValue(),
            new Image(Utility.ITEMS_TEXTUREATLAS.findRegion("inv_shield")));

    InventorySlot chestSlot =
        new InventorySlot(
            ItemUseType.ARMOR_CHEST.getValue(),
            new Image(Utility.ITEMS_TEXTUREATLAS.findRegion("inv_chest")));

    InventorySlot legsSlot =
        new InventorySlot(
            ItemUseType.ARMOR_FEET.getValue(),
            new Image(Utility.ITEMS_TEXTUREATLAS.findRegion("inv_boot")));

    headSlot.addListener(new InventorySlotTooltipListener(_inventorySlotTooltip));
    leftArmSlot.addListener(new InventorySlotTooltipListener(_inventorySlotTooltip));
    rightArmSlot.addListener(new InventorySlotTooltipListener(_inventorySlotTooltip));
    chestSlot.addListener(new InventorySlotTooltipListener(_inventorySlotTooltip));
    legsSlot.addListener(new InventorySlotTooltipListener(_inventorySlotTooltip));

    headSlot.addObserver(this);
    leftArmSlot.addObserver(this);
    rightArmSlot.addObserver(this);
    chestSlot.addObserver(this);
    legsSlot.addObserver(this);

    _dragAndDrop.addTarget(new InventorySlotTarget(headSlot));
    _dragAndDrop.addTarget(new InventorySlotTarget(leftArmSlot));
    _dragAndDrop.addTarget(new InventorySlotTarget(chestSlot));
    _dragAndDrop.addTarget(new InventorySlotTarget(rightArmSlot));
    _dragAndDrop.addTarget(new InventorySlotTarget(legsSlot));

    _playerSlotsTable.setBackground(
        new Image(new NinePatch(Utility.STATUSUI_TEXTUREATLAS.createPatch("dialog")))
            .getDrawable());

    // layout
    for (int i = 1; i <= _numSlots; i++) {
      InventorySlot inventorySlot = new InventorySlot();
      inventorySlot.addListener(new InventorySlotTooltipListener(_inventorySlotTooltip));
      _dragAndDrop.addTarget(new InventorySlotTarget(inventorySlot));

      _inventorySlotTable.add(inventorySlot).size(_slotWidth, _slotHeight);

      inventorySlot.addListener(
          new ClickListener() {
            @Override
            public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
              super.touchUp(event, x, y, pointer, button);
              if (getTapCount() == 2) {
                InventorySlot slot = (InventorySlot) event.getListenerActor();
                if (slot.hasItem()) {
                  InventoryItem item = slot.getTopInventoryItem();
                  if (item.isConsumable()) {
                    String itemInfo =
                        item.getItemUseType()
                            + Component.MESSAGE_TOKEN
                            + item.getItemUseTypeValue();
                    InventoryUI.this.notify(
                        itemInfo, InventoryObserver.InventoryEvent.ITEM_CONSUMED);
                    slot.removeActor(item);
                    slot.remove(item);
                  }
                }
              }
            }
          });

      if (i % _lengthSlotRow == 0) {
        _inventorySlotTable.row();
      }
    }

    _equipSlots.add();
    _equipSlots.add(headSlot).size(_slotWidth, _slotHeight);
    _equipSlots.row();

    _equipSlots.add(leftArmSlot).size(_slotWidth, _slotHeight);
    _equipSlots.add(chestSlot).size(_slotWidth, _slotHeight);
    _equipSlots.add(rightArmSlot).size(_slotWidth, _slotHeight);
    _equipSlots.row();

    _equipSlots.add();
    _equipSlots.right().add(legsSlot).size(_slotWidth, _slotHeight);

    _playerSlotsTable.add(_equipSlots);
    _inventoryActors.add(_inventorySlotTooltip);

    this.add(_playerSlotsTable).padBottom(20);
    this.add(labelTable);
    this.row();
    this.add(_inventorySlotTable).colspan(2);
    this.row();
    this.pack();
  }
예제 #9
0
  public void init() {
    add = new ParticleEffect();
    add.load(
        Gdx.files.internal(Setting.GAME_RES_PARTICLE + "addp.p"),
        Gdx.files.internal(Setting.GAME_RES_PARTICLE));
    add.setPosition(835, 111);

    render = new ShapeRenderer();
    render.setAutoShapeType(true);

    stage =
        new Stage(
            new ScalingViewport(
                Scaling.stretch,
                GameUtil.screen_width,
                GameUtil.screen_height,
                new OrthographicCamera()),
            GameMenuView.stage.getBatch());

    $.add(
            new ImageButton(
                Res.getDrawable(Setting.GAME_RES_IMAGE_MENU_GLOBAL + "exit.png"),
                Res.getDrawable(Setting.GAME_RES_IMAGE_MENU_GLOBAL + "exitc.png")))
        .setPosition(960, 550)
        .fadeOut()
        .addAction(Actions.parallel(Actions.fadeIn(0.2f), Actions.moveTo(960, 510, 0.1f)))
        .onClick(
            new Runnable() {
              @Override
              public void run() {
                Music.playSE("snd210");
                GameViews.gameview.stackView.disposes();
              }
            })
        .appendTo(stage);

    $.add(
            new ImageButton(
                Res.getDrawable(Setting.GAME_RES_IMAGE_MENU_GLOBAL + "min.png"),
                Res.getDrawable(Setting.GAME_RES_IMAGE_MENU_GLOBAL + "minc.png")))
        .setPosition(910, 550)
        .fadeOut()
        .addAction(Actions.parallel(Actions.fadeIn(0.2f), Actions.moveTo(910, 510, 0.1f)))
        .onClick(
            new Runnable() {
              @Override
              public void run() {
                GameViews.gameview.stackView.onkeyDown(Keys.ESCAPE);
                Music.playSE("snd210");
              }
            })
        .appendTo(stage);

    Image bg = Res.get(Setting.GAME_RES_IMAGE_MENU_ITEM + "item_bg.png");
    bg.setColor(1, 1, 1, 0);
    bg.setPosition(160, 28);
    bg.addAction(Actions.fadeIn(0.2f));
    stage.addActor(bg);

    ListStyle style = new ListStyle();
    style.font = FontUtil.generateFont(" ".toCharArray()[0], 22);
    style.selection = Res.getDrawable(Setting.GAME_RES_IMAGE_MENU_EQUIP + "equipsel.png");
    style.fontColorSelected = Color.valueOf("f5e70c");
    elist = new com.rpsg.rpg.system.ui.List<Item>(style);
    elist.onClick(
        new Runnable() {
          @Override
          public void run() {
            item = elist.getSelected();
            Music.playSE("snd210");
          }
        });
    elist.layout();
    pane = new ScrollPane(elist);
    pane.getStyle().vScroll = Res.getDrawable(Setting.GAME_RES_IMAGE_MENU_ITEM + "scrollbar.png");
    pane.getStyle().vScrollKnob =
        Res.getDrawable(Setting.GAME_RES_IMAGE_MENU_ITEM + "scrollbarin.png");
    pane.setForceScroll(false, true);
    pane.layout();

    Table table = new Table();
    table.add(pane);
    table.padRight(20);
    table.setPosition(170, 40);
    table.setSize(270, 390);
    table.getCell(pane).width(table.getWidth()).height(table.getHeight() - 20);
    table.setColor(1, 1, 1, 0);
    table.addAction(Actions.fadeIn(0.2f));
    stage.addActor(table);
    topbarSel = Res.get(Setting.GAME_RES_IMAGE_MENU_ITEM + "topsel.png");
    topbar = new Table();
    topbar.setBackground(Res.getDrawable(Setting.GAME_RES_IMAGE_MENU_ITEM + "topbar.png"));
    topbar.setSize(818, 42);
    topbar.setPosition(160, 455);
    int tmpI = 0, offsetX = 135;
    topbar.add(new TopBar("medicine", tmpI++ * offsetX));
    topbar.add(new TopBar("material", tmpI++ * offsetX));
    topbar.add(new TopBar("cooking", tmpI++ * offsetX));
    topbar.add(new TopBar("equipment", tmpI++ * offsetX));
    topbar.add(new TopBar("spellcard", tmpI++ * offsetX));
    topbar.add(new TopBar("important", tmpI++ * offsetX));
    for (Cell cell : topbar.getCells()) {
      cell.padLeft(50).padRight(34).height(40);
      cell.getActor()
          .addListener(
              new InputListener() {
                public boolean touchDown(
                    InputEvent event, float x, float y, int pointer, int button) {
                  Music.playSE("snd210");
                  return true;
                }
              });
    }

    stage.addActor(topbar);

    generateLists("medicine");

    final Actor mask = new Actor();
    mask.setWidth(GameUtil.screen_width);
    mask.setHeight(GameUtil.screen_height);
    mask.addListener(
        new InputListener() {
          public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            return false;
          }
        });
    stage.addActor(mask);
    scuse = Res.get(Setting.GAME_RES_IMAGE_MENU_SC + "sc_use.png");
    scuse.loaded =
        new Runnable() {
          @Override
          public void run() {
            scuse.setPosition(
                (int) (GameUtil.screen_width / 2 - scuse.getWidth() / 2),
                (int) (GameUtil.screen_height / 2 - scuse.getHeight() / 2));
          }
        };
    sellist = new com.rpsg.rpg.system.ui.List<ListItem>(style);
    sellist.onDBClick(
        new Runnable() {
          @Override
          public void run() {
            sellist.getSelected().run.run();
          }
        });
    can =
        new Runnable() {
          @Override
          public void run() {
            scuse.visible = false;
            sellist.setVisible(false);
            mask.setVisible(false);
            layer = 0;
          }
        };
    sellist.setPosition(368, 240);
    sellist.setSize(254, 100);
    sellist.layout();

    stage.addActor(
        sellist.onClick(
            new Runnable() {
              @Override
              public void run() {
                Music.playSE("snd210");
              }
            }));

    final Actor mask2 = new Actor();
    mask2.setWidth(GameUtil.screen_width);
    mask2.setHeight(GameUtil.screen_height);
    mask2.addListener(
        new InputListener() {
          public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            return false;
          }
        });

    elist.onDBClick(
        new Runnable() {
          @Override
          public void run() {
            scuse.visible = true;
            sellist.offsetX2 = 20;
            sellist.getItems().clear();
            if (item.type == Item.TYPE_USEINMAP)
              sellist
                  .getItems()
                  .add(
                      new ListItem("使用")
                          .setUserObject(Res.get(Setting.GAME_RES_IMAGE_ICONS + "yes.png"))
                          .setRunnable(
                              new Runnable() {
                                @Override
                                public void run() {
                                  scfor.visible = true;
                                  herolist.setVisible(true);
                                  mask2.setVisible(true);
                                  layer = 2;
                                }
                              }));
            if (item.throwable)
              sellist
                  .getItems()
                  .add(
                      new ListItem("丢弃")
                          .setUserObject(Res.get(Setting.GAME_RES_IMAGE_ICONS + "bin.png"))
                          .setRunnable(
                              new Runnable() {
                                @Override
                                public void run() {
                                  group.setVisible(true);
                                  mask2.setVisible(true);
                                  can.run();
                                  currentCount = 1;
                                  layer = 3;
                                }
                              }));
            sellist
                .getItems()
                .add(
                    new ListItem("取消")
                        .setUserObject(Res.get(Setting.GAME_RES_IMAGE_ICONS + "no.png"))
                        .setRunnable(
                            new Runnable() {
                              @Override
                              public void run() {
                                can.run();
                              }
                            }));
            sellist.onDBClick(
                new Runnable() {
                  @Override
                  public void run() {
                    sellist.getSelected().run.run();
                  }
                });
            sellist.setVisible(true);
            sellist.setSelectedIndex(0);
            sellist.setItemHeight(27);
            sellist.padTop = 2;
            mask.setVisible(true);
            layer = 1;
          }
        });

    stage.addActor(mask2);
    scfor = Res.get(Setting.GAME_RES_IMAGE_MENU_ITEM + "selbg.png");
    scfor.setPosition(500, 87);

    herolist = new com.rpsg.rpg.system.ui.List<ListItem>(style);
    herolist.offsetX2 = 20;
    herolist
        .getItems()
        .add(new ListItem("取消").setUserObject(Res.get(Setting.GAME_RES_IMAGE_ICONS + "no.png")));
    for (Hero h : HeroController.heros) {
      herolist.getItems().add(new ListItem(h.name).setUserObject(h));
    }

    herolist
        .onDBClick(
            new Runnable() {
              @Override
              public void run() {}
            })
        .onClick(
            new Runnable() {
              @Override
              public void run() {
                Music.playSE("snd210");
              }
            });
    herolist.setPosition(492, 273);
    herolist.setSize(257, 140);
    herolist.layout();
    stage.addActor(herolist);

    can2 =
        new Runnable() {
          @Override
          public void run() {
            scfor.visible = false;
            herolist.setVisible(false);
            mask2.setVisible(false);
            layer = 1;
          }
        };
    TextButtonStyle butstyle = new TextButtonStyle();
    butstyle.over =
        butstyle.checkedOver = Res.getDrawable(Setting.GAME_RES_IMAGE_GLOBAL + "button_hover.png");
    butstyle.down = Res.getDrawable(Setting.GAME_RES_IMAGE_GLOBAL + "button_active.png");
    butstyle.up = Res.getDrawable(Setting.GAME_RES_IMAGE_GLOBAL + "button.png");
    group = new Group();
    Image tbg = new Image(Setting.GAME_RES_IMAGE_MENU_SC + "throw.png");
    tbg.setPosition(350, 200);
    group.addActor(tbg);
    TextButton button;
    button =
        new TextButton("确定", butstyle)
            .onClick(
                new Runnable() {
                  @Override
                  public void run() {
                    ItemUtil.throwItem(currentBar.name, item, currentCount);
                    AlertUtil.add("丢弃成功。", AlertUtil.Yellow);
                    ItemView.this.generateLists(currentBar.name);
                    item = new TipItem();
                    can3.run();
                  }
                });
    button.setPosition(630, 290);
    button.setSize(100, 50);
    group.addActor(button);
    TextButton button2 =
        new TextButton("取消", butstyle)
            .onClick(
                new Runnable() {
                  @Override
                  public void run() {
                    can3.run();
                  }
                });

    button2.setPosition(630, 225);
    button2.setSize(100, 50);
    group.addActor(button2);
    ImageButton upbutton1 =
        new ImageButton(
            Res.getDrawable(Setting.GAME_RES_IMAGE_NUMBER + "up.png"),
            Res.getDrawable(Setting.GAME_RES_IMAGE_NUMBER + "ups.png"));
    upbutton1
        .onClick(
            new Runnable() {
              @Override
              public void run() {
                if (currentCount + 100 <= item.count) currentCount += 100;
              }
            })
        .setPosition(395, 340);
    group.addActor(upbutton1);
    ImageButton upbutton2 =
        new ImageButton(
            Res.getDrawable(Setting.GAME_RES_IMAGE_NUMBER + "up.png"),
            Res.getDrawable(Setting.GAME_RES_IMAGE_NUMBER + "ups.png"));
    upbutton2
        .onClick(
            new Runnable() {
              @Override
              public void run() {
                if (currentCount + 10 <= item.count) currentCount += 10;
              }
            })
        .setPosition(435, 340);
    group.addActor(upbutton2);
    ImageButton upbutton3 =
        new ImageButton(
            Res.getDrawable(Setting.GAME_RES_IMAGE_NUMBER + "up.png"),
            Res.getDrawable(Setting.GAME_RES_IMAGE_NUMBER + "ups.png"));
    upbutton3
        .onClick(
            new Runnable() {
              @Override
              public void run() {
                if (currentCount + 1 <= item.count) currentCount += 1;
              }
            })
        .setPosition(475, 340);
    group.addActor(upbutton3);
    ImageButton dbutton1 =
        new ImageButton(
            Res.getDrawable(Setting.GAME_RES_IMAGE_NUMBER + "down.png"),
            Res.getDrawable(Setting.GAME_RES_IMAGE_NUMBER + "downs.png"));
    dbutton1
        .onClick(
            new Runnable() {
              @Override
              public void run() {
                if (currentCount - 100 >= 1) currentCount -= 100;
              }
            })
        .setPosition(395, 240);
    group.addActor(dbutton1);
    ImageButton dbutton2 =
        new ImageButton(
            Res.getDrawable(Setting.GAME_RES_IMAGE_NUMBER + "down.png"),
            Res.getDrawable(Setting.GAME_RES_IMAGE_NUMBER + "downs.png"));
    dbutton2
        .onClick(
            new Runnable() {
              @Override
              public void run() {
                if (currentCount - 10 >= 1) currentCount -= 10;
              }
            })
        .setPosition(435, 240);
    group.addActor(dbutton2);
    ImageButton dbutton3 =
        new ImageButton(
            Res.getDrawable(Setting.GAME_RES_IMAGE_NUMBER + "down.png"),
            Res.getDrawable(Setting.GAME_RES_IMAGE_NUMBER + "downs.png"));
    dbutton3
        .onClick(
            new Runnable() {
              @Override
              public void run() {
                if (currentCount - 1 >= 1) currentCount -= 1;
              }
            })
        .setPosition(475, 240);
    group.addActor(dbutton3);

    Table buttable = new Table();
    buttable
        .add(
            new TextButton("最大", butstyle, 16)
                .onClick(
                    new Runnable() {
                      @Override
                      public void run() {
                        currentCount = item.count == 0 ? 1 : item.count;
                      }
                    }))
        .size(80, 33)
        .row();
    buttable
        .add(
            new TextButton("+1", butstyle, 16)
                .onClick(
                    new Runnable() {
                      @Override
                      public void run() {
                        if (currentCount < item.count) currentCount++;
                      }
                    }))
        .size(80, 35)
        .row();
    buttable
        .add(
            new TextButton("-1", butstyle, 16)
                .onClick(
                    new Runnable() {
                      @Override
                      public void run() {
                        if (currentCount > 1) currentCount--;
                      }
                    }))
        .size(80, 35)
        .row();
    buttable
        .add(
            new TextButton("最小", butstyle, 16)
                .onClick(
                    new Runnable() {
                      @Override
                      public void run() {
                        currentCount = 1;
                      }
                    }))
        .size(80, 33)
        .row();
    for (Cell c : buttable.getCells()) {
      c.padTop(2).padBottom(2);
    }

    buttable.setPosition(575, 300);
    group.addActor(buttable);
    stage.addActor(group);
    for (final Actor a : group.getChildren()) {
      a.addListener(
          new InputListener() {
            public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
              if (!(a instanceof Image)) Music.playSE("snd210");
              return true;
            }
          });
    }

    can3 =
        new Runnable() {
          @Override
          public void run() {
            group.setVisible(false);
            mask2.setVisible(false);
            can.run();
          }
        };
    can3.run();
    can2.run();
    can.run();
  }