# Example Projects (Spritesheet manipulation examples)

**URL:** <https://forums.solar2d.com/t/example-projects-spritesheet-manipulation-examples/342010>\
**Category:** Audio and Graphics\
**Created:** [November 15, 2016, 12:37am UTC](https://forums.solar2d.com/t/example-projects-spritesheet-manipulation-examples/342010 "2016-11-15T00:37:56Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jack95](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jack95](https://forums.solar2d.com/u/jack95)\
**Post date:** [November 15, 2016, 12:37am UTC](https://forums.solar2d.com/t/example-projects-spritesheet-manipulation-examples/342010/1 "2016-11-15T00:37:56Z")

</div>

I haven’t seen a project that shows how to use or properly load/unload spritesheets. Does anyone have a github link?

---

<div class="post-metadata">

**Author:** ![roaminggamer](https://forums.solar2d.com/user_avatar/forums.solar2d.com/roaminggamer/32/134_2.png) [@roaminggamer](https://forums.solar2d.com/u/roaminggamer)\
**Post date:** [November 15, 2016, 1:28am UTC](https://forums.solar2d.com/t/example-projects-spritesheet-manipulation-examples/342010/2 "2016-11-15T01:28:27Z")

</div>

Corona SDK comes with a number of examples bundled with the Simulator and there are at least a couple examples using sprite sheets.

1. Start the simulator.

2. Click the Samples link right there on the right side.

3. Try any of the animation samples…

---

<div class="post-metadata">

**Author:** ![jack95](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jack95](https://forums.solar2d.com/u/jack95)\
**Post date:** [November 16, 2016, 5:36pm UTC](https://forums.solar2d.com/t/example-projects-spritesheet-manipulation-examples/342010/3 "2016-11-16T17:36:00Z")

</div>

Using spritesheets, is not what I’m interested in. I’m interested of how to handle multiple spritesheets (not just use one).

---

<div class="post-metadata">

**Author:** ![roaminggamer](https://forums.solar2d.com/user_avatar/forums.solar2d.com/roaminggamer/32/134_2.png) [@roaminggamer](https://forums.solar2d.com/u/roaminggamer)\
**Post date:** [November 16, 2016, 6:31pm UTC](https://forums.solar2d.com/t/example-projects-spritesheet-manipulation-examples/342010/4 "2016-11-16T18:31:57Z")

</div>

That is not what your post says. &nbsp;In fact it doesn’t mention ‘multiple’ anywhere. &nbsp;&nbsp;

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](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 -&nbsp;

- I am trying to make a game that uses 50 sprite sheets over its lifetime, but only needs 10 ‘loaded’ at any one time. &nbsp;How do I do this such that I minimize my memory usage and not impact performance.

- OR -&nbsp;

- I am making a game that uses a lot of sprite sheets and I’m worried about managing memory and performance. &nbsp;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. &nbsp;So while I’d like to help, I’m not sure what I’m helping with exactly.&nbsp;

---

<div class="post-metadata">

**Author:** ![jack95](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jack95](https://forums.solar2d.com/u/jack95)\
**Post date:** [November 18, 2016, 11:10pm UTC](https://forums.solar2d.com/t/example-projects-spritesheet-manipulation-examples/342010/5 "2016-11-18T23:10:11Z")

</div>

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. &nbsp;How do I do this such that I minimize my memory usage and not impact performance.

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [November 20, 2016, 5:00pm UTC](https://forums.solar2d.com/t/example-projects-spritesheet-manipulation-examples/342010/6 "2016-11-20T17:00:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![roaminggamer](https://forums.solar2d.com/user_avatar/forums.solar2d.com/roaminggamer/32/134_2.png) [@roaminggamer](https://forums.solar2d.com/u/roaminggamer)\
**Post date:** [November 15, 2016, 1:28am UTC](https://forums.solar2d.com/t/example-projects-spritesheet-manipulation-examples/342010/7 "2016-11-15T01:28:27Z")

</div>

Corona SDK comes with a number of examples bundled with the Simulator and there are at least a couple examples using sprite sheets.

1. Start the simulator.

2. Click the Samples link right there on the right side.

3. Try any of the animation samples…

---

<div class="post-metadata">

**Author:** ![jack95](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jack95](https://forums.solar2d.com/u/jack95)\
**Post date:** [November 16, 2016, 5:36pm UTC](https://forums.solar2d.com/t/example-projects-spritesheet-manipulation-examples/342010/8 "2016-11-16T17:36:00Z")

</div>

Using spritesheets, is not what I’m interested in. I’m interested of how to handle multiple spritesheets (not just use one).

---

<div class="post-metadata">

**Author:** ![roaminggamer](https://forums.solar2d.com/user_avatar/forums.solar2d.com/roaminggamer/32/134_2.png) [@roaminggamer](https://forums.solar2d.com/u/roaminggamer)\
**Post date:** [November 16, 2016, 6:31pm UTC](https://forums.solar2d.com/t/example-projects-spritesheet-manipulation-examples/342010/9 "2016-11-16T18:31:57Z")

</div>

That is not what your post says. &nbsp;In fact it doesn’t mention ‘multiple’ anywhere. &nbsp;&nbsp;

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](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 -&nbsp;

- I am trying to make a game that uses 50 sprite sheets over its lifetime, but only needs 10 ‘loaded’ at any one time. &nbsp;How do I do this such that I minimize my memory usage and not impact performance.

- OR -&nbsp;

- I am making a game that uses a lot of sprite sheets and I’m worried about managing memory and performance. &nbsp;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. &nbsp;So while I’d like to help, I’m not sure what I’m helping with exactly.&nbsp;

---

<div class="post-metadata">

**Author:** ![jack95](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jack95](https://forums.solar2d.com/u/jack95)\
**Post date:** [November 18, 2016, 11:10pm UTC](https://forums.solar2d.com/t/example-projects-spritesheet-manipulation-examples/342010/10 "2016-11-18T23:10:11Z")

</div>

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. &nbsp;How do I do this such that I minimize my memory usage and not impact performance.

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [November 20, 2016, 5:00pm UTC](https://forums.solar2d.com/t/example-projects-spritesheet-manipulation-examples/342010/11 "2016-11-20T17:00:10Z")

</div>

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
