public void setSelectedWidget(int index) { if (widgets.size > index) { Actor newBar = widgets.get(index); if (newBar != toShow) { Color color = colors.get(index); setColor(color == null ? style.color : color); for (Actor widget : widgets) { widget.clearActions(); } Actor current = getActor(); if (current != null) { current.setTouchable(Touchable.disabled); } else { current = toShow; } toShow = newBar; Actor toHide = current; toHide.setOrigin(Align.center); if (toShow.getScaleY() == 1) { toShow.setScaleY(0); toShow.setOriginY(toHide.getOriginY()); toShow.getColor().a = 0; } float timeHide = ANIM_TIME * Math.abs(toHide.getScaleY()); Action actionShow = Actions.run(actionAddActor); Action actionHide = Actions.parallel( Actions.scaleTo(1, 0, timeHide, Interpolation.sineOut), Actions.fadeOut(timeHide)); if (newBar == current) { toHide.addAction(actionShow); } else { toHide.addAction(Actions.sequence(actionHide, actionShow)); } } } }
/** Adds the specified scale to the current scale. */ public void scale(float scaleX, float scaleY) { setScaleX(this.scaleX + scaleX); setScaleY(this.scaleY + scaleY); }
/** Adds the specified scale to the current scale. */ public void scale(float scale) { setScaleX(scaleX + scale); setScaleY(scaleY + scale); }
/** Sets the scalex and scaley. */ public void setScale(float scaleX, float scaleY) { setScaleX(scaleX); setScaleY(scaleY); }