Example usage for com.badlogic.gdx.scenes.scene2d Group swapActor

List of usage examples for com.badlogic.gdx.scenes.scene2d Group swapActor

Introduction

In this page you can find the example usage for com.badlogic.gdx.scenes.scene2d Group swapActor.

Prototype

public boolean swapActor(Actor first, Actor second) 

Source Link

Document

Swaps two actors.

Usage

From source file:com.uwsoft.editor.gdx.mediators.ItemControlMediator.java

License:Apache License

public void itemZIndexChange(HashMap<IBaseItem, SelectionRectangle> currentSelection, boolean isUp) {
    for (SelectionRectangle value : currentSelection.values()) {
        sceneControl.getCurrentScene().updateDataVO();

        int ammount = 1;
        if (!isUp)
            ammount = -1;/*from  w ww .j a va 2  s  .  c  o  m*/

        int setting = value.getHostAsActor().getZIndex() + ammount;
        if (setting < 0)
            setting = 0;
        Group parent = value.getHostAsActor().getParent();
        parent.swapActor(value.getHostAsActor().getZIndex(), setting);

        sceneControl.getCurrentScene().updateDataVO();
    }
}