Question regarding dynamic spritesheets

I was going through https://www.codeandweb.com/texturepacker/tutorials/dynamic-content-scaling-for-corona-sdk to know more about content scaling using sprite-sheets.

I downloaded the attached source code and found out that there was two sets of sprite-sheet images(normal & prefixed @2x) which is fine.

But what I couldn’t comprehend was the existence of two sprite-sheet information files( normal & prefixed @2x).

From what I have learned so far, that by using sheetContentWidth & sheetContentHeight, corona automatically fetches the right sprite-sheet image based on the size of the content area screen, provided image suffix was defined in the config file.

So why is there a prefixed(@2x) version of sprite-sheet information file? Is it redundant?

Yes and no.

If the sprite sheets are identical in structure, then you just need the file for the normal sized layout, making the @2x variant redundant. This should always be the case when you use the AutoSD feature.

Now, if you were to export two different variant sprite sheets that don’t have the same structure, i.e. it’s not just the scaling that is different, but there may be different images, or images may be in different coordinates, etc., then you require those files for the other layouts.

Also, while Corona loads images dynamically, it doesn’t do so with code files. So even if you had sheetInfo.lua and sheetInfo@2x.lua, that @2x variant would never be loaded unless you explicitly made Corona load it.

Thanks a lot @Xedur for clarifying this.