How to use assets in subfolders?

Seems I can’t reference subfolders once a project is imported. This seems common for assets at least. [import]uid: 7587 topic_id: 5560 reply_id: 305560[/import]

When CPM was designed the prevailing word was that all assets had to be in the root location of the project – so I coded it assuming that would be the case.

You can use assets in folders in CPM, you just can’t (at this point) access them from the program. But if you drag in a folder called images that has all your graphics in it, and then do this in your code:

local sky = display.newImage( "images/bkg\_clouds.png" )

…things will work just fine.

I do intend to allow access to assets in folders in the future, there are just some things I need to figure out first. The main thing is that a Project in CPM is *not* a folder on your drive. It can be, but doesn’t have to be. So if you double click a folder in the asset list, what should it show?

Maybe I should assume that if you drag a folder into the asset list that you want to add all files in that folder as assets. But then do I put a “watch” on that folder so if you drop another file in there it adds it to the asset list? And, do I allow any number of levels deep, so you could drag your hard drive to the asset list and drill down forever? :slight_smile:

It’s not really a technical problem I can’t work around, it’s a user experience problem I don’t want to screw up.

Probably more info than you wanted, but there you go. The story behind why you can’t access folders in the asset list.

Jay

[import]uid: 9440 topic_id: 5560 reply_id: 18947[/import]

I’m with J.A.

The cool thing with CMP is (I suppose … I don’t get it yet) the ability to turn off/on any element in one main project window, whatever the real place of those objects (images in subfloers, …).

Am I wrong ? [import]uid: 9328 topic_id: 5560 reply_id: 19580[/import]

You are not wrong. The thing about CPM is that projects are virtual, so it’s easy to share code, graphics, etc., without having duplicate files on your drive. But if you do want a separate file creating a duplicate your project is one click away.

Jay [import]uid: 9440 topic_id: 5560 reply_id: 19654[/import]

I bought CPM, and well, it’s not that clear to me.
I tried to drag and drop a folder (with the famous subfolder images in it) : images in this subfolder don’t appear in the window…

Maybe things are easier when you start a project from the ground up in CPM…

BTW, I just can’t make anything “run” properly, always getting the
"
bash: /Applications/Corona.268/Corona Terminal/Contents/MacOS/Corona Simulator: Not a directory
"report … [import]uid: 9328 topic_id: 5560 reply_id: 21485[/import]

@Antheor – see the second post in this thread for info about subfolders. They will be added in a future version, I’m still trying to figure out what makes “sense” since projects in CPM can be virtual – they don’t automatically map to a location on your drive.

As far as the Launch thing goes, open Prefs and change the Location to point to the Corona Simulator, not the Corona Terminal. Apparently I didn’t get one of the tutorial videos changed and it’s still telling people the old thing.

Make that change and your Launch button will then work.

Jay
[import]uid: 9440 topic_id: 5560 reply_id: 21562[/import]

Blame on me.
Trying to organize things via folders, subfolders is not a good idea. I have suffered the past days errors and bugs all related to folder organization.

I realized that putting all lua files in one main folder and having system like CPM create virtual organization is the best way to work.

[import]uid: 9328 topic_id: 5560 reply_id: 21667[/import]

Hi Jay … Just saw this thread… I had mailed about the folder thing I think.

I’d love to have an entire folder imported where I could click the folder and it would drop down a list of the assets inside it. And then yes, I’d like it to watch that folder for anything new and automatically add it.

I use folders for keeping things neat… I don’t want to drag 40 images in… and typically when I do an app, I make an “images” folder and everything for that app’s images go there… so when I add one, it should just get added to the project – that would be way helpful and a huge time saver.

However, I get that this could go either way for people, so I think “watch folders” as an options would be the ideal… or if you want to get all hardcore, right click a folder and “don’t watch this folder”.
Thanks!!
[import]uid: 13859 topic_id: 5560 reply_id: 22105[/import]

Same thing with me. The new version has a way to go into a folder see whats in there and come out so great move in the right direction. Only thing I would change is the little icon next to the folder name if possible in a later version. Thank you very much Jay for listening to us and delivering. [import]uid: 11904 topic_id: 5560 reply_id: 23837[/import]

I had the same issue with regards subfolders however I have solved it by dragging first the outer folder “images” into CPM then I go into this folder and drag my subfolder “score” into the “images” folder

I can then use code like the following in CPM and it appears to work fine.

[code]

digit1Anim = movieclipRetina.newAnim({ “images/score/score0.png”, “images/score/score1.png”,etc}, 10,17)

[/code] [import]uid: 7863 topic_id: 5560 reply_id: 56496[/import]