Hi Vince,
In a complete “slap forehead” moment, I may have a solution to your issue. Instead of using “display.newImageRect()”, use “display.newImage()”. Also, do not set the object’s width/height anytime after… leave it as it’s rendered.
I know you understand the basic differences between these 2 APIs, but here’s the catch: because (and only because) you’re pulling a frame from an image sheet, you should still get the proper “suffixed” image using “display.newImage()”, properly pulled from the appropriate default, @2x, and @4x sheets (or however you’ve set them up and named the suffixes).
When dealing with static images (files) and dynamic scaling, we always recommend “display.newImageRect()”, but in this case, assuming you’ve properly set up the image sheets with the “sheetContentWidth” and “sheetContentHeight” properties (it looks like you have), Corona should “know” the sheet to pull the image from and how to size it accordingly, without you ever needing to specify any width/height on the display side (merely in the sheet setup side).
Can you please test this out? My initial findings on this were not taking trimming into account (sourceX, sourceY, etc.) so perhaps it won’t work after all… but it’s worth a shot.
Brent









