Codea 3.0 (106)

Codea 3.0 103

  • Craft spotlight rotation fix
  • Fix duplicate project functionality
  • Fix crash when Add from Photos is selected in Documents folder
  • Fix crash when using color parameter on iPhone
  • Update Multi Touch example code to check for touches cancelled

@Simeon The Craft spotlight rotation works. The project duplicate works. The add from photos works. The sprite() fix works. I don’t have an iPhone so I can’t check that and I don’t know about the multi touch.

PS. I found the multi touch report. After restoring the examples, I couldn’t get a circle to remain.

@dave1707 thank you for checking through everything! I really appreciate it

@simeon, @john, yippie! the spotlight orientation is fixed. My submarine can find its way now!

https://youtu.be/_KouglhP4Qs

@Simeon Here’s something that doesn’t work quite right, but it doesn’t matter that much.

  1. Open a project.
  2. Tap screen to bring up the keyboard.
  3. Tap the eye icon to open the built in reference.
  4. Select Craft, then Craft.entity.
  5. Hide the keyboard.
  6. Notice that the text wraps correctly to show everything.
  7. Rotate the keyboard.
  8. Everything is truncated.

@piinthesky Interesting video. Can you make the submarine a little brighter so it shows up better. Enough so the submarine is visible but not enough to diminish the spotlight effect.

@dave1707 i could probably move the location of the spotlight towards the back, so it also illuminates more of the submarine. Otherwise i could use ‘basic’ material rather than ‘standard’ or ‘specular’. ‘Basic’ seems to be bright and ignores the ambient light level.

@piinthesky love your submarine video! You could have a couple of spotlights that are just anchored to the submarine and follow it around to give it a nice rim lighting effect

@dave1707 thank you for the steps, will try it out

@Simeon - I know I have probably done something stupid but can you explain this:


displayMode(FULLSCREEN)
-- Use this function to perform your initial setup
function setup()
    sW, sH, sW2, sH2 = WIDTH, HEIGHT, WIDTH/2, HEIGHT/2
    square = image(96,96)
    setContext(square)
        fill(216, 30, 47, 255)
        stroke(225, 204, 80, 255)
        strokeWidth(5)
        rect(0,0,sW2,sH2)
    setContext()
end

-- This function gets called once every frame
function draw()
    -- This sets a dark background color 
    background(59, 110, 45, 255)
    sprite(square, sW2,sH2)
    fill(35, 93, 199, 255)
    stroke(175, 81, 228, 255)
    strokeWidth(5)
    rect(336,360,96,96)
end

With the ability to put emoticons in the sidebar I tried to ‘print’ sprites into the sidebar to try to set up a slide-on control panel for games etc. No joy, so I thought why not set up your own by drawing an image incorporating the sprites and sliding that on. But I had a problem with the image borders.

Or, is this a flaw in Codea?

Can you explain?

@Bri_G Is this what you’re trying to do.

displayMode(FULLSCREEN)

function setup()
    sW, sH, sW2, sH2 = WIDTH, HEIGHT, WIDTH/2, HEIGHT/2
    square = image(96,96)
    setContext(square)
        fill(216, 30, 47, 255)
        stroke(225, 204, 80, 255)
        strokeWidth(5)
        rect(0,0,96,96)
    setContext()
end

function draw()
    background(59, 110, 45, 255)
    sprite(square, sW2,sH2)   
    fill(35, 93, 199, 255)
    stroke(175, 81, 228, 255)
    strokeWidth(5)
    rect(336,360,96,96)
end

@piinthesky I don’t know how you defined the submarine, but maybe you can do something like this. Both cubes are the same, but one is dark and the other is defined with the light and shows up bright.

function setup()
    scene = craft.scene()
    scene.ambientColor = color(0)
    scene.sun.active = false  
    scene.sky.active = false  
      
    v=scene.camera:add(OrbitViewer, vec3(0,2,-4), 12, 0, 200)
    
    --create cube without light
    c=scene:entity():add(craft.renderer, craft.model.cube(vec3(1,1,1)))
    c.entity.material = craft.material("Materials:Standard")
    c.entity.material.map = readImage("Blocks:Trunk White Top")
    c.material.diffuse=color(255,255,0)
    
    --create light
    pt=scene:entity():add(craft.light,POINT)
    pt.entity.position=vec3(0,2,0)
    pt.distance=0 
   
    -- create cube with light    
    c=pt.entity:add(craft.renderer, craft.model.cube(vec3(1,1,1)))
    c.material = craft.material("Materials:Basic")
    c.material.map = readImage("Blocks:Trunk White Top")
    c.material.diffuse=color(255,255,0)
end

function update(dt)
    scene:update(dt)
end

function draw()
    update(DeltaTime)
    scene:draw()    
end

@dave1707 - oops, senior moment thanx for pointing it out. Knew it was obvious but couldn’t see it. Duhhhh!!!

@dave1707 @simeon, thanks! I have anchored a point source to illuminate the back…

https://youtu.be/z-4OAhuv-1w

I also added a bright icosphere on the front to simulate the source of the spotlight…

https://youtu.be/DSpTIanMGq8

@piinthesky That’s a lot better, being able to see the submarine.

@Simeon Very minor issue with the 102 build on IPad but 103 has fixed. I was unable to revert to the App Store version by downloading again through there. The button was “Open” instead of the little cloud icon and stayed that way after restarting IPad. Almost insignificant but it’s nice to know there’s an easy way back when testing.

Edit: Please disregard, actually seems to be an App Store bug on iOS 10. Icon just switched to Open for 103 after going onto updates screen (Codea is in my recently updated list) but installing something else fixes it.

arrrrggggghhhh! i thought i would tidy up a bit, so in the files app i created a folder for each of my ongoing projects and moved all the versions of the projects to their appropriate folder. When i went back to Codea all the files still exist but are now empty! if i look at their size in the files app they are zero bytes. @simeon any ideas if i can recover??

@piinthesky I tried that and the projects stick around in Codea, but if I toggle the project icon size they disappear. When I moved the projects back out of the folder I’d created into the root Codea folder then toggled the project icon size once more my projects reappeared and were accessible.

Edit: If you name your folder “Name.collection” in the Files app, then drag the projects in, they will appear in the project browser under a collection of that name (toggle the icon size to force a refresh). Not officially supported yet but it seems to work for me.

@piinthesky If you get all your projects back, the first thing you should do is an Export Projects that will backup all your projects into a single zip file. You can then import all or selected projects. You won’t have to worry about losing projects.

@piinthesky let me know if you have any luck. Could you possibly export the projects from the Files app by copying them elsewhere? Or sharing them

@simeon i have not figured out how to move them out of the new project folder i made back to root codea folder! it does not let me move them to ‘on my ipad’? The files app is a real mess! hopefully the size indicated by ‘info’ is wrong.

i was wrong in my previous message-they did disappear from the codea main screen.

i will continue to investigate.