I haven’t seen a project that shows how to use or properly load/unload spritesheets. Does anyone have a github link?
Corona SDK comes with a number of examples bundled with the Simulator and there are at least a couple examples using sprite sheets.
-
Start the simulator.
-
Click the Samples link right there on the right side.
-
Try any of the animation samples…
Using spritesheets, is not what I’m interested in. I’m interested of how to handle multiple spritesheets (not just use one).
That is not what your post says. In fact it doesn’t mention ‘multiple’ anywhere.
However, using multiple sprite sheets for a single animated object is covered in the docs here:
https://docs.coronalabs.com/daily/api/library/display/newSprite.html#multiple-image-sheets
Note: If I’ve yet again not understood your question, please add more details below and give us some ‘for example’ notes so it is possible to drill down on what you’re trying to do and learn.
EX:
-
I am trying to create a sprite that can use multiple sprite sheets over the course of the animation.
-
OR -
-
I am trying to make a game that uses 50 sprite sheets over its lifetime, but only needs 10 ‘loaded’ at any one time. How do I do this such that I minimize my memory usage and not impact performance.
-
OR -
-
I am making a game that uses a lot of sprite sheets and I’m worried about managing memory and performance. Are there any best practices you can share, and are there any really good examples that show me these practices?
I know you know what you want, but when I read the title and post body, it is a little nebulous. So while I’d like to help, I’m not sure what I’m helping with exactly.
I’m sorry I wasn’t clear. I am not sure how to articulate. This best expresses my concern:
- I am trying to make a game that uses 50 sprite sheets over its lifetime, but only needs 10 ‘loaded’ at any one time. How do I do this such that I minimize my memory usage and not impact performance.
Spritesheets start their lives as a graphics.newImageSheet() object.
local myImageSheet = graphics.newImageSheet( ... )
To dispose of the image sheet:
myImageSheet = nil
That’s how you get rid of one you’re no longer needing.
Rob
Corona SDK comes with a number of examples bundled with the Simulator and there are at least a couple examples using sprite sheets.
-
Start the simulator.
-
Click the Samples link right there on the right side.
-
Try any of the animation samples…
Using spritesheets, is not what I’m interested in. I’m interested of how to handle multiple spritesheets (not just use one).
That is not what your post says. In fact it doesn’t mention ‘multiple’ anywhere.
However, using multiple sprite sheets for a single animated object is covered in the docs here:
https://docs.coronalabs.com/daily/api/library/display/newSprite.html#multiple-image-sheets
Note: If I’ve yet again not understood your question, please add more details below and give us some ‘for example’ notes so it is possible to drill down on what you’re trying to do and learn.
EX:
-
I am trying to create a sprite that can use multiple sprite sheets over the course of the animation.
-
OR -
-
I am trying to make a game that uses 50 sprite sheets over its lifetime, but only needs 10 ‘loaded’ at any one time. How do I do this such that I minimize my memory usage and not impact performance.
-
OR -
-
I am making a game that uses a lot of sprite sheets and I’m worried about managing memory and performance. Are there any best practices you can share, and are there any really good examples that show me these practices?
I know you know what you want, but when I read the title and post body, it is a little nebulous. So while I’d like to help, I’m not sure what I’m helping with exactly.
I’m sorry I wasn’t clear. I am not sure how to articulate. This best expresses my concern:
- I am trying to make a game that uses 50 sprite sheets over its lifetime, but only needs 10 ‘loaded’ at any one time. How do I do this such that I minimize my memory usage and not impact performance.
Spritesheets start their lives as a graphics.newImageSheet() object.
local myImageSheet = graphics.newImageSheet( ... )
To dispose of the image sheet:
myImageSheet = nil
That’s how you get rid of one you’re no longer needing.
Rob