Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Question regarding dynamic spritesheets
Started by Qiler Sep 21 2019 09:27 PM

2 replies to this topic
spritesheets
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

Qiler

[GLOBAL: userInfoPane.html]
Qiler
  • Observer

  • 2 posts
  • Corona SDK

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?



[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 944 posts
  • Corona SDK

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.


  • Qiler likes this

[TOPIC: post.html]
#3

Qiler

[GLOBAL: userInfoPane.html]
Qiler
  • Observer

  • 2 posts
  • Corona SDK

Thanks a lot @Xedur for clarifying this.


[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: spritesheets