@Override public void add(Actor actor) { if (getChildren().size >= 1) { actor.setVisible(false); } super.add(actor); }
private Actor setupLastElement() { final int nextElement = (currentElement - 1 + getChildren().size) % getChildren().size; final Actor next = getChildren().get(nextElement); if (!next.isVisible()) { next.getColor().a = 0; next.setVisible(true); next.setPosition(-animationXOffset, 0); next.clearActions(); } return next; }