# Sprite Sheets not working

**URL:** <https://forums.solar2d.com/t/sprite-sheets-not-working/285736>\
**Category:** Outlaw Game Tools\
**Created:** [December 25, 2010, 9:19pm UTC](https://forums.solar2d.com/t/sprite-sheets-not-working/285736 "2010-12-25T21:19:04Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![gellyware](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/g/85f322/32.png) [@gellyware](https://forums.solar2d.com/u/gellyware)\
**Post date:** [December 25, 2010, 9:19pm UTC](https://forums.solar2d.com/t/sprite-sheets-not-working/285736/1 "2010-12-25T21:19:04Z")

</div>

When I run my code from corona project manager, I get this:

“module ‘sprite’ not found:resource (sprite.lu) does not exist in archive  
no field package.preload[‘sprite’]”

along with other errors regarding not being able to find the files needed for local sprite=require"sprite"  
If I run my same code out of corona it works fine.

Please help!! [import]uid: 11632 topic\_id: 4699 reply\_id: 304699[/import]

---

<div class="post-metadata">

**Author:** ![J\_A\_Whye](https://forums.solar2d.com/user_avatar/forums.solar2d.com/j_a_whye/32/74_2.png) [@J\_A\_Whye](https://forums.solar2d.com/u/J_A_Whye)\
**Post date:** [December 27, 2010, 12:56am UTC](https://forums.solar2d.com/t/sprite-sheets-not-working/285736/2 "2010-12-27T00:56:06Z")

</div>

I’ve run quite a few sprite-based projects in CPM so it’s something other than “sprite sheets don’t work.”

In the Ansca sample projects I’m seeing

```auto
require "sprite"
```

…and not…

```auto
local sprite = require "sprite"
```

Not sure if that would be the source of your problems, but it’s something to check out.

Also, not sure if it was just a copy/paste typo, but part of the error message you show:

```auto
resource (sprite.lu) does not exist
```

…makes it look as if it’s looking for a file called sprite.lu – should that be sprite.lua?

If none of those things makes a difference zip up the file and send it to me: [j@jawhye.com](mailto:j@jawhye.com)

Jay  
[import]uid: 9440 topic\_id: 4699 reply\_id: 14917[/import]

---

<div class="post-metadata">

**Author:** ![ksan](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/k/a5b964/32.png) [@ksan](https://forums.solar2d.com/u/ksan)\
**Post date:** [December 27, 2010, 5:31am UTC](https://forums.solar2d.com/t/sprite-sheets-not-working/285736/3 "2010-12-27T05:31:27Z")

</div>

They work for me as well. Did you drag & drop all assets into CPM? [import]uid: 11904 topic\_id: 4699 reply\_id: 14928[/import]

---

<div class="post-metadata">

**Author:** ![J\_A\_Whye](https://forums.solar2d.com/user_avatar/forums.solar2d.com/j_a_whye/32/74_2.png) [@J\_A\_Whye](https://forums.solar2d.com/u/J_A_Whye)\
**Post date:** [December 27, 2010, 1:50pm UTC](https://forums.solar2d.com/t/sprite-sheets-not-working/285736/4 "2010-12-27T13:50:19Z")

</div>

Oh, ksan has a good point – CPM doesn’t look in your project folder on your drive – it only cares about the assets you’ve specified in the CPM project (which is by design, so you can have extra code, graphics, etc., and not worry about them getting mixed in with only the stuff you need to build your project).

Make sure all the files referenced in your code are added as assets in the CPM project.

Jay [import]uid: 9440 topic\_id: 4699 reply\_id: 14951[/import]

---

<div class="post-metadata">

**Author:** ![gellyware](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/g/85f322/32.png) [@gellyware](https://forums.solar2d.com/u/gellyware)\
**Post date:** [December 27, 2010, 5:37pm UTC](https://forums.solar2d.com/t/sprite-sheets-not-working/285736/5 "2010-12-27T17:37:13Z")

</div>

I just created a new project in corona, with a main.lua that only has this:

local sprite = require (“sprite”)  
and I get the following:

Copyright © 2009-2010 A n s c a , I n c .  
Version: 2.0.0  
Build: 2010.9.16.148  
The file sandbox for this project is located at the following folder:  
(/Users/charlesaudler/Library/Application Support/Corona Simulator/43-FA205199E2670C33DBCA4AF7EE0DC98A)  
Runtime error  
…yiCznVGACEx2QTeG7ytk+++TI/TemporaryItems/43/main.lua:11: module ‘sprite’ not found:resource (sprite.lu) does not exist in archive  
no field package.preload[‘sprite’]  
no file ‘/private/var/folders/Tm/TmyiCznVGACEx2QTeG7ytk+++TI/TemporaryItems/43/sprite.lua’  
no file ‘/Applications/Corona.243/CoronaSDK/Corona Simulator.app/Contents/Resources/sprite.lua’  
no file ‘/Applications/Corona.243/CoronaSDK/Corona Simulator.app/Contents/Resources/sprite.blu’  
stack traceback:  
[C]: ?  
[C]: in function ‘require’  
…yiCznVGACEx2QTeG7ytk+++TI/TemporaryItems/43/main.lua:11: in main chunk  
Runtime error: …yiCznVGACEx2QTeG7ytk+++TI/TemporaryItems/43/main.lua:11: module ‘sprite’ not found:resource (sprite.lu) does not exist in archive  
no field package.preload[‘sprite’]  
no file ‘/private/var/folders/Tm/TmyiCznVGACEx2QTeG7ytk+++TI/TemporaryItems/43/sprite.lua’  
no file ‘/Applications/Corona.243/CoronaSDK/Corona Simulator.app/Contents/Resources/sprite.lua’  
no file ‘/Applications/Corona.243/CoronaSDK/Corona Simulator.app/Contents/Resources/sprite.blu’  
stack traceback:  
[C]: ?  
[C]: in function ‘require’  
…yiCznVGACEx2QTeG7ytk+++TI/TemporaryItems/43/main.lua:11: in main chunk  
[import]uid: 11632 topic\_id: 4699 reply\_id: 14971[/import]

---

<div class="post-metadata">

**Author:** ![ksan](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/k/a5b964/32.png) [@ksan](https://forums.solar2d.com/u/ksan)\
**Post date:** [December 27, 2010, 5:42pm UTC](https://forums.solar2d.com/t/sprite-sheets-not-working/285736/6 "2010-12-27T17:42:38Z")

</div>

Can you post your newly created project here? I can try to run it on my end and see what happens. [import]uid: 11904 topic\_id: 4699 reply\_id: 14972[/import]

---

<div class="post-metadata">

**Author:** ![gellyware](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/g/85f322/32.png) [@gellyware](https://forums.solar2d.com/u/gellyware)\
**Post date:** [December 27, 2010, 5:57pm UTC](https://forums.solar2d.com/t/sprite-sheets-not-working/285736/7 "2010-12-27T17:57:01Z")

</div>

Thanks for the help!

I just tried re-installing corona and then tried the project(s) and they work fine.

Maybe something became corrupt at some point. It’s just weird that it worked in corona terminal but not cpm.

Thanks again!! [import]uid: 11632 topic\_id: 4699 reply\_id: 14973[/import]

---

<div class="post-metadata">

**Author:** ![ksan](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/k/a5b964/32.png) [@ksan](https://forums.solar2d.com/u/ksan)\
**Post date:** [December 27, 2010, 6:03pm UTC](https://forums.solar2d.com/t/sprite-sheets-not-working/285736/8 "2010-12-27T18:03:16Z")

</div>

Glad to hear its allright. Have fun! [import]uid: 11904 topic\_id: 4699 reply\_id: 14974[/import]

---

<div class="post-metadata">

**Author:** ![J\_A\_Whye](https://forums.solar2d.com/user_avatar/forums.solar2d.com/j_a_whye/32/74_2.png) [@J\_A\_Whye](https://forums.solar2d.com/u/J_A_Whye)\
**Post date:** [December 27, 2010, 6:35pm UTC](https://forums.solar2d.com/t/sprite-sheets-not-working/285736/9 "2010-12-27T18:35:48Z")

</div>

Weird, but glad it works now! Thanks for the follow-up!

Jay  
[import]uid: 9440 topic\_id: 4699 reply\_id: 14975[/import]

---

<div class="post-metadata">

**Author:** ![duneunit](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@duneunit](https://forums.solar2d.com/u/duneunit)\
**Post date:** [January 2, 2011, 2:18am UTC](https://forums.solar2d.com/t/sprite-sheets-not-working/285736/10 "2011-01-02T02:18:42Z")

</div>

I could sure use help. Having a similar problem. New to Lua. I am trying to create a separate class file called “CreditsDlg.lua”. No matter what I do, the program chokes at this line:

```auto
require ("CreditsDlg.lua")  
```

Here’s what it says:

Copyright © 2009-2010 A n s c a , I n c .  
Version: 2.0.0  
Build: 2010.243  
The file sandbox for this project is located at the following folder:  
(/Users/user1/Library/Application Support/Corona Simulator/3-C53476FEA1D65A7C47F1F26AD09181DE)  
Runtime error  
…E+BWrGIG4WsMEgxZpXxFE+++TI/TemporaryItems/3/main.lua:4: module ‘CreditsDlg.lua’ not found:resource (CreditsDlg.lua.lu) does not exist in archive  
no field package.preload[‘CreditsDlg.lua’]  
no file ‘/private/var/folders/UE/UE+BWrGIG4WsMEgxZpXxFE+++TI/TemporaryItems/3/CreditsDlg.lua.lua’  
no file ‘/Applications/Corona.243/Corona Simulator.app/Contents/Resources/CreditsDlg.lua.lua’  
no file ‘/Applications/Corona.243/Corona Simulator.app/Contents/Resources/CreditsDlg.lua.blu’  
no file ‘/Applications/Corona.243/Corona Simulator.app/Contents/Resources/CreditsDlg.blu’  
stack traceback:  
[C]: ?  
[C]: in function ‘require’  
…E+BWrGIG4WsMEgxZpXxFE+++TI/TemporaryItems/3/main.lua:4: in main chunk  
Runtime error: …E+BWrGIG4WsMEgxZpXxFE+++TI/TemporaryItems/3/main.lua:4: module ‘CreditsDlg.lua’ not found:resource (CreditsDlg.lua.lu) does not exist in archive  
no field package.preload[‘CreditsDlg.lua’]  
no file ‘/private/var/folders/UE/UE+BWrGIG4WsMEgxZpXxFE+++TI/TemporaryItems/3/CreditsDlg.lua.lua’  
no file ‘/Applications/Corona.243/Corona Simulator.app/Contents/Resources/CreditsDlg.lua.lua’  
no file ‘/Applications/Corona.243/Corona Simulator.app/Contents/Resources/CreditsDlg.lua.blu’  
no file ‘/Applicat  
ions/Corona.243/Corona Simulator.app/Contents/Resources/CreditsDlg.blu’  
stack traceback:  
[C]: ?  
[C]: in function ‘require’  
…E+BWrGIG4WsMEgxZpXxFE+++TI/TemporaryItems/3/main.lua:4: in main chunk

I don’t understand why it is searching for “CreditsDlg.lua.lu” among other things. I reinstalled Corona just to see if that would do anything different. No luck.

Thanks for any insight on this. [import]uid: 10818 topic\_id: 4699 reply\_id: 15283[/import]

---

<div class="post-metadata">

**Author:** ![J\_A\_Whye](https://forums.solar2d.com/user_avatar/forums.solar2d.com/j_a_whye/32/74_2.png) [@J\_A\_Whye](https://forums.solar2d.com/u/J_A_Whye)\
**Post date:** [January 2, 2011, 12:56pm UTC](https://forums.solar2d.com/t/sprite-sheets-not-working/285736/11 "2011-01-02T12:56:26Z")

</div>

Try doing this:

[lua]require (“CreditsDlg”)[/lua]

Don’t include the .lua suffix and see what happens.

Jay [import]uid: 9440 topic\_id: 4699 reply\_id: 15300[/import]

---

<div class="post-metadata">

**Author:** ![duneunit](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@duneunit](https://forums.solar2d.com/u/duneunit)\
**Post date:** [January 2, 2011, 10:22pm UTC](https://forums.solar2d.com/t/sprite-sheets-not-working/285736/12 "2011-01-02T22:22:38Z")

</div>

Jay-

Thanks for the reply! I tried that before, but I was missing this line at the top of my class file:

```auto
module(..., package.seeall)
```

That, combined with removing the ‘.lua’ extension, did the trick. Thanks!

-Dune [import]uid: 10818 topic\_id: 4699 reply\_id: 15319[/import]

---

<div class="post-metadata">

**Author:** ![Dev-Ze.rocks](https://forums.solar2d.com/user_avatar/forums.solar2d.com/dev-ze.rocks/32/719_2.png) [@Dev-Ze.rocks](https://forums.solar2d.com/u/Dev-Ze.rocks)\
**Post date:** [November 26, 2013, 10:37pm UTC](https://forums.solar2d.com/t/sprite-sheets-not-working/285736/13 "2013-11-26T22:37:53Z")

</div>

Just if somebody runs into this error again,

Now it is a REAL problem, because the sprite library is no more supported and included!!

[http://docs.coronalabs.com/api/library/sprite/index.html](http://docs.coronalabs.com/api/library/sprite/index.html)

This came with the update to Graphics 2.0 …

You now have to use [display.newSprite()](http://docs.coronalabs.com/api/library/display/newSprite.html) …

---

<div class="post-metadata">

**Author:** ![Dev-Ze.rocks](https://forums.solar2d.com/user_avatar/forums.solar2d.com/dev-ze.rocks/32/719_2.png) [@Dev-Ze.rocks](https://forums.solar2d.com/u/Dev-Ze.rocks)\
**Post date:** [November 26, 2013, 10:37pm UTC](https://forums.solar2d.com/t/sprite-sheets-not-working/285736/14 "2013-11-26T22:37:53Z")

</div>

Just if somebody runs into this error again,

Now it is a REAL problem, because the sprite library is no more supported and included!!

[http://docs.coronalabs.com/api/library/sprite/index.html](http://docs.coronalabs.com/api/library/sprite/index.html)

This came with the update to Graphics 2.0 …

You now have to use [display.newSprite()](http://docs.coronalabs.com/api/library/display/newSprite.html) …
