import com.badlogic.gdx.graphics.g2d.Animation;
public Entity(int animId, float x, float y, int width, int height) {
this.animation = ResourceHandler.getAnimation(animId);
}
@Override
public float getWidth() {
return this.animation.getKeyFrame(this.stateTime).getRegionWidth();
}
引发错误Cannot resolve method 'getRegionWidth()'
这段代码来自教程,所以不确定为什么它不起作用。