Libgdx 铁路超高';真正设置演员';那是津德克斯吗? public类字符扩展了Actor{ @凌驾 公共作废提取(批处理、浮动parentAlpha){ int zIndex=10000-(int)this.getY(); if(zIndex
我想把演员的zIndex设定为y 但结果是: 9979999 9980999 9982999 9983999 9983999 9985999 9986999 9986999 9986999 ……哦,我明白了Libgdx 铁路超高';真正设置演员';那是津德克斯吗? public类字符扩展了Actor{ @凌驾 公共作废提取(批处理、浮动parentAlpha){ int zIndex=10000-(int)this.getY(); if(zIndex,libgdx,Libgdx,我想把演员的zIndex设定为y 但结果是: 9979999 9980999 9982999 9983999 9983999 9985999 9986999 9986999 9986999 ……哦,我明白了 Actor的zIndex的最大值为999 zIndex的最大值是它及其同级的计数减去1。 public class Character extends Actor { @Override public void draw(Batch batch, float parent
Actor的zIndex的最大值为999
zIndex
的最大值是它及其同级的计数减去1。
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);
}
}