At some point after creating a project in Outlaw maybe you create an “images” folder in the project folder on your hard drive and then try to use the images inside that folder like this:
local alien = display.newImage("images/alien.png")
…and then you get an error message that alien.png can’t be found. What the…?
The first thing you should do is follow the instructions in this blog post to see what files are being passed to the simulator: What Files Are Being Launched?
If you discover the images folder isn’t even there, here’s how to fix that:
Drag the images folder from your hard drive into the project in Outlaw (drop it on top of the project where you want that folder). Now it — and all the files that are inside that folder at the time you add it to the project — will be available for use.
Why Does Outlaw Work That Way?!?!?!
In a nutshell, Outlaw allows you to do things that Lua knows nothing about, so there’s kind of a “pre-processor” step that takes shortcuts, etc., and turns them into Lua code and then writes that file out to the hard drive. So the simulator can run it, but you still have your original source code available.
Plus, Outlaw allows you to rename files on the fly, include or exclude files from the project by clicking a checkbox, etc., and all that requires the simulator to run files that may or may not be in your project folder.
A Sneaky Way Around This
Once you have an images folder in your project, maybe you want it to pick up all PNG files you throw in there. In that case, right click the images folder in the project tree and choose Properties. A pane should open on the right.
In that pane, check the Auto-Add Assets checkbox and then in Audo Add Suffixes include any file suffixes you’d like Outlaw to include. For example, you might do:
…and that would include all PNG and JPG files you throw in that folder, but it will NOT add the Photoshop PSD files with your work files, etc.
You can also Auto Add Suffixes to the main project properties and have it pick up .lua files, etc.