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
.....
答案 0 :(得分:0)
Actor的zIndex的最大值是999.