我试图设置边界矩形的位置。如何设置BoundingRectangle位置
spr.getBoundingRectangle().setPosition(100,100);
Sytem.out.println(spr.getBoundingRectangle.getX() + " " + spr.getBoundingRectangle.getX());
// and the output is always 0,0(position)
我也试图设置它的位置,只要条件==真
if(justTouched == true){
spr.getBoundingRectangle().setPosition(100,100);
Sytem.out.println(spr.getBoundingRectangle.getX() + " " + spr.getBoundingRectangle.getX());
}// but the result is the same
我所做的是在x,y坐标上渲染精灵,而不是在渲染之前设置位置,batch.draw(spr,x,y); –