Пример #1
0
  /**
   * brings the card up to the front and center, leaving a space where it belongs in the hand.
   * Nothing other than the card and its controls can be clicked during a zoom. Tapping the card
   * unzooms it. There also is a cancel, play, and rotate button, and arrows to see the next and
   * previous cards in the hand.
   *
   * @param toAdd card to zoom in on
   */
  private void zoomCard(CardGroup toAdd) {
    zoomCard = toAdd;
    // remove toAdd from the hand and add it to the root
    zoomReturnIndex = cards.getChildren().indexOf(toAdd, true);
    zoomCard.remove();
    addActor(zoomCard);
    makeSpace(zoomReturnIndex);

    zoomCard.getActions().clear();
    // blow the card up
    zoomCard.addAction(Actions.scaleTo(3.0f, 3.0f, 0.2f, Interpolation.pow2));
    // move it
    zoomCard.addAction(Actions.moveTo(600, 100, 0.2f, Interpolation.pow2));

    // make only the zoom elements touchable
    for (Actor actor : getChildren()) {
      actor.setTouchable(Touchable.disabled);
    }
    zoomGroup.setTouchable(Touchable.enabled);
    zoomGroup.setVisible(true);
    updateZoomControls();
  }