How do we do imagesheet sprites so they are scalable for retina displays?
display.newSprite seems to properly load my “image@2x.png” instead of my “image.png”. However,
if I make my sheet data at 1x scale, the sprites are the right size (45 points) but don’t load from the correct positions and the images get cut off. If I make my sheet data at 2x scale then the sprites come out 2 times bigger than they should be (90 points vs 45 points) and I have to use xScale and yScale = 0.5 to make them fit. Scaling down the display object doesn’t seem to be the right way to do this. The image sheets article doesn’t include any clear examples of how to handle the retina graphics.
1x sheet data:
{
{
{ x=334, y=185, width=45, height=45 }
},
sheetContentWidth = 512,
sheetContentHeight = 651
}
2x sheet data:
{
{
{ x=654, y=340, width=90, height=90 }
},
sheetContentWidth = 988,
sheetContentHeight = 1266
}
[import]uid: 2927 topic_id: 28527 reply_id: 328527[/import]