Dropboxing 3D objects

@pac - obj files can hold color but it has to be incorporated in the file with the right format. It is not used very often. When applied it just colours the vertices, so you can add colour gradients or solid coloured triangles.

Most users tend to use textures as that gives you a much better 3D effect. They are incorporated in the obj file as a series of points which relate to a specific texture and vertex. You need to read up on this - chase up the 3D epub from ignatz on his website - you might find it in the Codea wiki.

Oh, when using textures you also need a materials file which incorporates lighting properties and texture file details.

Its okay I have found every thing I need for the color.

How do you set the pivot point of an object?

Thanks Pac

What file type can I put into codea to add music?

Thanks Pac

.wav

.mp3

Oh thats great.

Thank you so much.
Thanks again pac

pac it would help others – like me – if you would post some examples of how you’ve done things. :slight_smile: thanks!

What things do you need posted?

Or what areas more like.

:wink:

Can you program in app purchases?

Okay got a question.

So how can you get a loop to print all the sprites from drop box on the the screen?

Thank @Pac

Look in the built in reference under Storage for assetList.

Okay thank, different question how do you pass in a table to a tween path with out knowing how many point there will be.

Oh okay I went and checked the reference and I fell dumb. But I get that felling a lot.

Thanks Pac.

@pac Here’s an example showing all the sprites in Blocks.

function setup()
    al=assetList("Blocks",SPRITES)
    for a,b in pairs(al) do
        print(a,b)
    end
    fill(255)
end

function draw()
    background(40, 40, 50)    
    x,y=1,1
    for a,b in pairs(al) do
        sprite("Blocks:"..b,x*65,y*65,50)
        x=x+1
        if x>10 then
            y=y+1
            x=1
        end
    end
    text("Blocks",WIDTH/2,HEIGHT-50)
    text("use landscape orientation",WIDTH/2,HEIGHT-100)
end

@pac This doesn’t pass a table to tween, but it uses one in tween. I’m using the Asset list from the above code.

displayMode(FULLSCREEN)

function setup()
    al=assetList("Blocks",SPRITES)
    sp={x=0,y=HEIGHT/2,a=1}
    tween(5,sp,{x=WIDTH,y=HEIGHT/2,a=#al},
        {easing=tween.easing.linear,loop=tween.loop.once})
end

function draw()
    background(40, 40, 50)
    sprite("Blocks:"..al[sp.a//1],sp.x,sp.y,50)
end

How can you tell if a tween has finished?

Add a function to the tween. In this case, done.

displayMode(FULLSCREEN)

function setup()
    str=""
    al=assetList("Blocks",SPRITES)
    sp={x=0,y=HEIGHT/2,a=1}
    tween(5,sp,{x=WIDTH,y=HEIGHT/2,a=#al},
        {easing=tween.easing.linear,loop=tween.loop.once},done)
    fill(255)
end

function draw()
    background(0)
    sprite("Blocks:"..al[sp.a//1],sp.x,sp.y,50)
    text(str,WIDTH/2,HEIGHT/2)
end

function done()
    str="DONE"    
end

Got it Thanks

Thank You so much.

Hi,

You can use tween.hasExpired() function (not documented)

displayMode(FULLSCREEN)

function setup()

    al=assetList("Blocks",SPRITES)
    sp={x=0,y=HEIGHT/2,a=1}
    id=tween(5,sp,{x=WIDTH,y=HEIGHT/2,a=#al},
        {easing=tween.easing.linear,loop=tween.loop.once})
    fill(255)
end

function draw()
    background(0)
    sprite("Blocks:"..al[sp.a//1],sp.x,sp.y,50)
    
    if tween.hasExpired(id) then
       text("Done",WIDTH/2,HEIGHT/2)
    end 

end

@Diablo76 Thanks for the update. I wonder how many other undocumented functions there are.