Esempio n. 1
0
 /**
  * Swaps two actors. Returns false if the swap did not occur because the actors are not children
  * of this group.
  */
 public boolean swapActor(Actor first, Actor second) {
   int firstIndex = children.indexOf(first, true);
   int secondIndex = children.indexOf(second, true);
   if (firstIndex == -1 || secondIndex == -1) return false;
   children.swap(firstIndex, secondIndex);
   return true;
 }
Esempio n. 2
0
 /**
  * Adds an actor as a child of this group, immediately before another child actor. The actor is
  * first removed from its parent group, if any.
  */
 public void addActorBefore(Actor actorBefore, Actor actor) {
   actor.remove();
   int index = children.indexOf(actorBefore, true);
   children.insert(index, actor);
   actor.setParent(this);
   actor.setStage(getStage());
   childrenChanged();
 }
Esempio n. 3
0
 /**
  * Adds an actor as a child of this group, immediately after another child actor. The actor is
  * first removed from its parent group, if any.
  */
 public void addActorAfter(Actor actorAfter, Actor actor) {
   actor.remove();
   int index = children.indexOf(actorAfter, true);
   if (index == children.size) children.add(actor);
   else children.insert(index + 1, actor);
   actor.setParent(this);
   actor.setStage(getStage());
   childrenChanged();
 }