is there some way to view and move assets inside a codea project?

ipad Files app can’t look inside a codea project. (i vaguely recall this is because codea projects aren’t quite folders?) anyway, is there some way to view and move them with Files that i’ve missed?

thanks!

Are you asking if you can view a Codea project from the Files app or looking at Codea files, png, mtl, obj, etc. In the Files app, if you long press on something you get a popup with several options.

i have found no way in Files, to drill into a Codea project and see its assets. Nor any other way to see the assets of a Codea project, in Files.

Are you looking for something that will give you a list of all the assets in all of your projects.

no, i want to browse them with Files app, and do all the stuff Files app is good for. i know how to write a file browser and here in the 21st century don’t think i should have to.

If you want the Files app to do all those things, this sure isn’t the place to ask for it. You can try sending your Files requests to Apple, but don’t hold your breath. Apple does what they want, with no regards to anything you want. You could probably write your own before you get any changes like that from Apple.

PS. I’m not saying Apple will never do what you request. A long time ago, I sent a request to Apple to put the day and date at the top of the screen next to the time. I explained why I wanted it and why I thought it would be a good idea. An iOS release or two later, there it was.

my point is, codea is set up so that files can’t see inside projects, despite that projects are basically folders. or, there might be some way to look in that i’m not aware of.

@RonJeffries I’m not sure if this explains anything, but from the Files app Codea folder, I can share a Codea project with the app I have called iZip. From iZip I can look at the contents of the files for that project. Depending on the project, there’s multiple tab files and plist. There might be other files depending on what’s in a more complex Codea project. So if the Files app can share those files, they’re contents are available. Maybe Files doesn’t know how to open them by their file type extensions.

PS. It let me look a png files, and obj files. Trying to find other projects that have other files in it.

Hi Guys - just another idea - I think you can export a Codea zip file to a PC or Mac, then extract that and edit the files within it. Then re-zip and transfer to downloads on the iPad. From there I think you can reinstall into Codea by selecting and sharing with Codea. Messy but could get the job done. Seem to remember doing something similar to add graphics to Codea projects in the ‘Old Days’.

@RonJeffries The way I open files within a Codea file is by first downloading an app called Documents which you can download by using this link here: https://apps.apple.com/us/app/documents-by-readdle/id364901807

After downloading and setting up the app, all you need to do is open the files app, allow it to see the documents app files, look for the .Codea file that you want to open, and move it to documents. Once it’s in documents just rename the file and remove the .Codea file extension, when that’s done you should see it as a folder which you can open and see all the lua, sound, image, and music files you have in that project.

When you are done dragging and dropping files, just rename it again and add the .Codea file extension, long tap it, and share it back to Codea.

Hope it helps!

@joaquin thanks … not what i’d call safe or convenient.

folks, i understand all these around the horn ways of doing it. i want codea to make its projects legal folders so it can work natively.

@RonJeffries I can understand the frustration involved with managing assets within a project as I run into this problem a bit too when making my own projects.

One of the main problems is that we adopted Apple’s document model for projects, making our .codea format a bundle. A bundle in iOS is simply a folder with an extension, however this also means that it becomes opaque to the Files app which then treats it as a single file for all intents and purposes. This means we have to hand code all file management UI in some way that lets you copy/paste, insert/delete, rearrange, rename, drag/drop, etc. I think the actual solution to this problem is to add support for folders as projects or something similar so that we get all the functionality of the Files app without reinventing the wheel.

There is also the asset browser which you can access whenever tapping on an asset bubble in function that takes an asset, which lets you delete and move assets, but only supports adding images I think. This is a bit of a holdover from when there wasn’t anything like the Files app or drag and drop, so most people just used dropbox or made a custom project to transfer stuff.

@simeon is working on a much improved UI for managing assets, which will have a sidebar allowing for much more control

https://twitter.com/twolivesleft/status/1350662650552696835?s=20

thanks … i look forward to the new stuff. just spent like four hours renaming and moving a tile set.

@RonJeffries - two things - don’t you use any Cloud storage? and have you thought of using a Sprite sheet?

@RonJeffries - another thought, I have used tables for assets in a project save purely to link for dependencies. If done properly you can reduce the number of edits, for instance you can set up a path to a folder then move or rename the folder but have just one edit in the path.

Don’t use cloud storage for this. How might it help?

A sprite sheet could be a good idea, but in fact the stuff I have is separate tiles.

I don’t understand the tables, link for dependencies, etc. A few more words, or an example, would get it across.

Thanks,

R

@RonJeffries - simple little demo here with a list of sprites (if used often could be in a dependency). A mapped sprite list by number pointed to by path. I tend to use Dropbox to hold the sprites just to minimise my memory usage on the iPad - plus it’s backed up and, at the level I use it, free.

A sprite sheet is ideal for this as you strip them out and put them in array - so can be accessed by an index. Also an a sprite array makes displaying subsets easier, further changing a sprite in the array amounts to just replacing the sprite number in the array and doesn’t need further management to maintain it’ state.

-- listing sprites demo

function setup()
    —
    gridX,gridY = 20,20
    spSize = 32
    top =gridY*spSize+250
    map = {
            1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
            1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
            1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
            1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
            1,3,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
            1,3,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
            1,3,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
            1,3,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
            1,3,2,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
            1,3,2,2,2,3,3,3,3,3,3,3,2,3,3,3,3,3,3,1,
            1,3,2,2,3,3,3,3,2,2,2,3,3,2,2,2,2,3,3,1,
            1,3,2,2,2,2,3,2,3,3,3,2,3,2,3,3,3,2,3,1,
            1,3,2,2,3,2,3,2,3,3,3,2,3,2,3,3,3,2,3,1,
            1,3,2,2,3,2,3,2,3,3,3,2,3,2,3,3,3,2,3,1,
            1,3,2,2,3,2,3,2,3,3,3,2,3,2,3,3,3,2,3,1,
            1,3,2,2,3,2,3,3,2,2,2,3,3,2,3,3,3,2,3,1,
            1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
            1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
            1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,
            1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
            }
    
    path = asset.builtin.UI
    tile = {
            "Blue_Button_08",
            "Blue_Button_01",
            "Blue_Button_06"
            }
end

function draw()
    background(40, 40, 50)
    for y = gridY,1,-1 do
        for x = 1, gridX do
            z = map[(y-1)*gridX+x]
            tl = map[z]
            sprite(path[tile[z]],48+x*spSize,top-y*spSize,spSize,spSize)
        end
    end
end

i think of a sprite sheet as a single graphics file with lots of images in it. i don’t see a decent way in codea to display a chunk of an image. could copy them but wha??

@RonJeffries - you need to know the location of each of the images on a Sprite sheet and the size. Can be found by trial and error.
Then you use image:copy() to copy a section of the sheet. Check it out in the reference.
I have a sheet with about 140 sprites on it with a large map to build up a viewing window so you can scroll it.

Have you looked at any of the free Sprite sheets on the net. They may be better than the in-house Codea graphics. They also provide animation capabilities.