广东话'真的设置了演员的zIndex?

时间:2017-04-18 03:57:39

标签: libgdx

public class Character extends Actor {

    @Override
    public void draw(Batch batch, float parentAlpha) {


        int zIndex = 10000 - (int)this.getY();
        if (zIndex < 0) {
            zIndex = 0;
        }

        setZIndex(zIndex);
        System.out.println(zIndex + "\t" + getZIndex());

        batch.draw(currFrame,  getX(), getY(), getOriginX(), getOriginY(),getWidth(), getHeight(), getScaleX(), getScaleY(), getRotation());

        super.draw(batch, parentAlpha);
    }
}

我希望通过y设置Actor&#39的索引,

但结果是:

...

9979 999

9980 999

9982 999

9983 999

9983 999

9985 999

9986 999

9986 999

9986 999

.....

1 个答案:

答案 0 :(得分:0)

哦,我明白了。

Actor的zIndex的最大值是999.