bp74 / StageXL

A fast and universal 2D rendering engine for HTML5 and Dart.
http://www.stagexl.org
Other
880 stars 82 forks source link

Texture Packer polygon packing results in image sizes rendering 2x the size when @2x pixel ratio #325

Closed mnordine closed 1 year ago

mnordine commented 4 years ago

The images on stage look roughly double the size, and are offset on x and y axis (to the right and down)

@1x works fine.

bp74 commented 4 years ago

Hi, there is an example for HiDPI images: https://github.com/bp74/StageXL_Samples/tree/master/example/basic/bitmap_data_hidpi

you have to load the @1x images in your application, and the runtime will automatically load the @2x images as needed.

You can also specify the available pixel ratios for the HiDPI images: StageXL.bitmapDataLoadOptions.pixelRatios = [1.00, 1.25, 1.50, 2.00, 3.00];

mnordine commented 4 years ago

Yeah, in that example, you've used MaxRects algorithm. Test that baby out at @2x with Polygon algo.

mnordine commented 4 years ago

@bp74 Were you able to reproduce with Polygon @2x?