Hello everyone,
i don’t understand why after scaling a sprite the rectangle that is supposed to be drawn at the same position,scale of the sprite is somehow “off” the way, here is two images that explain my problem:
sprite scale = 1
http://s27.postimg.org/upqk887j7/scale1.png
sprite scale = 0.5
http://s27.postimg.org/gkkr6eyhv/scale2.png
and this is how am setting up the rectangle :
// set get rectangle ;
public void setRect() {
Rectangle rect = new Rectangle();
//change the rectangle size to match the sprite
rect.width = sprite.getWidth()*scale;
rect.height = sprite.getHeight()*scale;
rect.x = sprite.getX();
rect.y = sprite.getY();
this.rectangle = rect;
}
thank you