Codea 3.2.6 (242)

@dave1707 - quick query for you, tried to get an asset list from a folder in my Dropbox storage and Codea, this line crashed Codea - error report posted.


flist = assetList("asset.documents.Dropbox.images",SPRITES)

What I am trying to do is create lists of several directories on Dropbox - of SPRITES. So that I can select them with parameters - folder and file, using the new asset addressing.

The rest of the code just tried to display the selected sprite.

@Bri_G Are you trying to do something like this.

viewer.mode=STANDARD

function setup()   
    file={  asset.documents.all,
            asset.documents.Craft.all,
            asset.documents.Examples.all,
            asset.documents.Templates.all,
            asset.builtin.all,
            asset.documents.Craft.Voxel_Editor.all,
            asset.documents.Craft.Froggy.all,
            asset.documents.Dropbox.all,
        }
    str={   "asset.documents.all",
            "asset.documents.Craft.all",
            "asset.documents.Examples.all",
            "asset.documents.Templates.all",
            "asset.builtin.all",
            "asset.documents.Craft.Voxel_Editor.all",
            "asset.documents.Craft.Froggy.all",
            "asset.documents.Dropbox.all",
        }
    
    extTab={"all","codea","assets","lua","png","plist","cvox","shader",""}
    typeTab={"all","project","folder","shaders","sprites","other","text","models"}    
   
    parameter.integer("offset",1,#file,create)
    parameter.integer("exts",1,#extTab,create)   
    parameter.integer("typs",1,#typeTab,create)   

    dy=-30
    dx=0
    textMode(CORNER)
end

function create()
    output.clear()
    dy=-30
    tab=file[offset]
    print(str[offset])
    print("exts ",extTab[exts])
    print("typs ",typeTab[typs])
end
    
function draw()
    background(0)
    fill(255)
    cnt=0
    for a,b in pairs(tab) do
        if extTab[exts]=="all" and typeTab[typs]=="all" then
            display(b)
        elseif extTab[exts]=="all" then
            if b.type==typeTab[typs] then
                display(b)
            end
        elseif typeTab[typs]=="all" then
            if b.ext==extTab[exts] then
                display(b)
            end
        elseif b.type==typeTab[typs] and b.ext==extTab[exts] then
            display(b)
        end
    end
    rect(0,HEIGHT-30,WIDTH,HEIGHT-30)
    fill(0)
    text("Name",20+dx,HEIGHT-25)
    text("Ext",250+dx,HEIGHT-25)
    text("Type",350+dx,HEIGHT-25)
    text("Path",450+dx,HEIGHT-25)
end
    
function display(b)
    cnt=cnt+1            
    n=nameOnly(b.name)
    text(n,20+dx,HEIGHT-cnt*25+dy)
    text(b.ext,250+dx,HEIGHT-cnt*25+dy)
    text(b.type,350+dx,HEIGHT-cnt*25+dy)
    text(b.path,450+dx,HEIGHT-cnt*25+dy)
end

function touched(t)
    if t.state==MOVING then
        dy=dy+t.deltaY
        if dy<-30 then
            dy=-30
        end
        dx=dx+t.deltaX
        if dx>0 then
            dx=0
        end
    end
end

function nameOnly(name)
    st=string.find(name,".",1,true)
    if st then
        return string.sub(name,1,st-1)
    end
    return name
end

@dave1707 - not exactly, something not too far removed and much simpler. Seems like I always try to make things far too complicated. Thanks for the prompt reply - I’ll start again using your example. Thanks again.