Closed videlais closed 1 year ago
Hm, I can see this being slightly confusing. Cause Sprite(scale_image: X) isn't the same as sprite.setScale(x).
scale_image argument to Sprite() prescales the image (with a simple algo resulting in retrostyle hard borders).
setScale(x) sets internal variable scale_x and scale_y which is used at drawtime. So scale_x/scale_y should "survive" a setImage().
prescaling with scale_image-argument is also available in SpriteSheet(), Animation() etc..
Currently, when using setImage with a Sprite, it will ignore any previous set scale_x, scale_y, or scale_image properties. I can't decide if this is an issue or not with setImage. However, if it is not, then should setScale be included in Sprite?
sprite = new jaws.Sprite({image: "path/initial image", scale_image: number});
Basically, should it be:
sprite.setImage("path/new image"); //Internal scaling
or:
sprite.setImage("path/new image"); sprite.setScale(number);
or even:
sprite.setImage(jaws.gfx.retroScaleImage("path/new image"), sprite.scale);