Codea 3.0 (186)

@Simeon When I tap on the TwoLivesLeft icon at the bottom of the project list page, it show the Codea Credits screen, but then it shows the keyboard and the sign in for iTunes and prompts for my iTunes password.

@Simeon Is the print window now ignored for the WIDTH size. If the print window is showing and I text something at 50,200 , it’s behind the print window. It used to be offset from the windows edge. Or do we now have to use that new stuff you added for the screen areas.

PS. Apparently displayMode(STANDARD) isn’t the default anymore.

@Simeon The batteryLevel and batteryState works great. Please add Wi-Fi signal strength if you can. Can you give us a list of other info that’s available and we can give you some feedback as to what’s useful or not before you add it.

@Simeon Assets list no longer switches to a single column. That’s good.

@Simeon Does the Bitcode have anything to do with code on the iPad or is that just for exported code.

@Simeon readimage directly after saveImage works OK.

@dave1707 the credits screen does that now to check when you first purchased Codea. This is so that if I make Codea free in the future I can make it unlocked for all existing users. I put the code on the credits screen to test it.

Yes I changed displayMode(OVERLAY) to the default. Standard doesn’t make much sense on iPhone (you can see about 50 pixels across), and I always liked overlay better on iPad too.

I looked into Wi-Fi signal strength and couldn’t find clear details on how to do it or if it’s even allowed. It’s not something I can add to 3.0 but will keep looking.

Thank you for testing the other bugs, bitcode is just for exported code and how Codea itself is compiled now.

@Simeon Thanks for the explanations. There are several apps that show the Wi-Fi level, but they’re constantly popping up ads every time they update the value. So you can’t just walk around and watch the signal strength change. If it was in Codea, it would be easy to write something useful.

Here’s some code to view the battery level. Each time the battery level changes the table is updated with the time and level. The longer the program runs, the more info that’s displayed on the screen. You can use this to see how fast the battery level decreases over time. Graphics can probably be used but I’ll leave that for someone else or I’ll do it later.

displayMode(FULLSCREEN)

function setup()
    fill(255)
    tab={}
    table.insert(tab,{dt=os.date(),lv=deviceMetrics().batteryLevel})
end

function draw()
    background(0)    
    if deviceMetrics().batteryLevel~=tab[#tab].lv then
        table.insert(tab,{dt=os.date(),lv=deviceMetrics().batteryLevel})
    end
    for a,b in pairs(tab) do
        text(string.format("%-35s %2.1f%%",b.dt,b.lv*100),WIDTH/2,HEIGHT-a*30)
    end
    text("State - "..deviceMetrics().batteryState,WIDTH-100,HEIGHT-50)
end

@Simeon I just tried to export my project and archive it in XCode and it looks like the Frameworks still don’t have bitcode support. I tried removing the old Frameworks to allow XCode to download new ones.

@exomut I’ll be rebuilding the frameworks soon too

@Simeon You said you made displayMode(OVERLAY) the default. Since any text statements are now displayed from the left edge of the screen they’ll show under the print window. I think FULLSCREEN should be the default. If you’re not going to print something or use parameters you shouldn’t have to set the displayMode to FULLSCREEN to remove the overlay. If anyone wants to print something or show parameters, then they would know that they should set the displayMode to STANDARD or OVERLAY.

@Simeon When I’m at the Codea project page, if I tap the top left icon, I can tap Assets and see the full list of assets. If I’m in a project, I usually put a sprite() statement in the code and tap between the () to see the Project Assets folder and some of the other assets. Then I remove the sprite statement since I didn’t really need it. Have I been missing something or is there an easy way to see the full list of assets from inside a project.

You’re talking about using the text function? That’s an interesting point. What if the coordinate system started at the right edge of the panel? So x = 0 would be where the line of the panel is, but the panel would still be transparent. Something to think about for a future release though, I think the overlay default is necessary for the phone version, it’s just too cramped otherwise.

I’m planning to re-write Assets so that they can be viewed in the project, and you can access them anywhere on your file system (and use other cloud providers, not just Dropbox). At the moment you still need to do the parameter-tapping-thing, but I’m going to make it a sidebar option in the editor like the Reference and Find & Replace windows, then allow drag-and-drop assets into code.

@Simeon I’m not sure if I was very clear in that previous post. If the displayMode is OVERLAY or FULLSCREEN, the x value would be relative from the left side of the screen. If the displayMode is STANDARD, the x value would be relative from the right side of the panel. That’s how it was and is now, so everything is fine. I just think the default for the displayMode should be FULLSCREEN instead of OVERLAY. So if you’re not printing or using parameters, you don’t have to do anything for displayMode. If you do want to print or use parameters, then you would set the displayMode to OVERLAY or STANDARD depending on how you want the display to look like for the print or parameters.

As for the Assets, what you say sounds great.

@Simeon,@dave1707 - on the OVERLAY vs FULLSCREEN debate I prefer to use OVERLAY during development and switch to FULLSCREEN when the project is finished. But I think this discussion is not necessary - when I first started using Codea someone posted asking about editing the template - something I intended doing but never got round to. If it is still viable then you can add what you want to your own template. Perhaps an option for template choice could be added to new project - default or personal template - that way you can set up your own preference. Perhaps someone could write a Codea project to build a personal project template and add it to the new project menu.

@Simeon Thanks. I can’t wait. I hope I can finally release to the app store :slight_smile:

@dave1707 @Bri_G The way I always deal with displayMode in my projects is by putting this at the top of each project:

    DEBUG = hasProject("Debug Key")
    if DEBUG then
        displayMode(OVERLAY)
        -- Other debug code
    else
        displayMode(FULLSCREEN_NO_BUTTONS)
    end

I then have a project named “Debug Key” so when I send the file to another iPad or export to XCode, it won’t find the project and choose fullscreen.

@exomut - neat way in dealing with the issue. Could you have a dependency holding one file with all keys in and read the key from there. Just trying to avoid having empty projects as keys. Or, you could have a security project which sets up system variables which can be tested in your project. If you accidentally reset the variables just run the security project again to re-initialise them.

@Bri_G It is actually convenient that it is an empty project. If I want to quickly turn off DEBUG mode for all of my projects to let someone try one of my apps, I just have to delete the project. When I am done, I just create the “Debug Key” project again.

But you could easily make it more complex by putting a list of keys inside and reading them too.

@exomut @Bri_G When I start a new project, I delete the majority of code that’s already there before I start coding. Years ago I suggested that you could have a startup project in your project list. You put whatever you want in it and every time a new project is created that project format is used. If the startup project doesn’t exist then the way a project is created now is used. I guess we all have our own way of doing something. Below is how I always start which is why I think the default displayMode should be FULLSCREEN. I’m not doing any printing or using parameters.

function setup()
end

function draw()
    background(0)
end