Codea 2.3 Beta

@JakAttak loading with readImage worked indeed, tho I thought the ipad 3 should have the capacity to use 4096x4096, so idk why the direct spriting acts funky

@stevon8ter, yup sounds like it might be a bug since it works with readImage

@JakAttak The maximum image size is 4096 / ContentScaleFactor. The reason newer iPads have a max of “2048,” is because it is actually 4096, but the retina screen doubles it.

I’ve been playing with 2.3 and generally apart from some string formats needing to be %f rather than %d for integers my projects all seem fine.

I had a bit of a play on integers and performance and they don’t seem to make a big difference, I remember the days of old school machines like C64s etc integers were massively better, I guess in the world of modern CPUs float performance is so good that changing things to ints doesn’t give you a boost…

My stuff all appears to be working correctly with the exception of having to fix the parameters to clip to be integers. Whilst I agree with @Simeon that they should be integers anyway, I would have thought a simple cast / conversion on the back end might make the function more accessible to beginners and that a back end cast is probably faster than having to call math.floor() from Lua.

Although generally speaking clip isn’t normally the kind of function you call many times per frame anyway.

One question though - when exporting code for app store release, will the 2.2 or the 2.3 version of the run time be used - and will it make a difference as most of the 2.3 fixes would appear to backwards compatible (well apart from the setenv stuf).

@TechDojo if you export from Codea 2.3 then the resulting project will use the 2.3 library, which includes Lua 5.3. If you export from 2.2 it uses the 2.2 library. (The Xcode libs are tied to the version of Codea.)

@Simeon - thanks that’s great. I’m hoping to submit a new update in the next couple of weeks so I’ll be doing it with the new 2.3 libs (unless you specifically don’t want me to).

@TechDojo it’s fine to use the new libs if they work for you. Note that the next beta of Codea 2.3 should fix your setting WIDTH / HEIGHT issue, let me know if it causes any problems.

Also note that the Codea 2.3 libs downloaded by Xcode are updated every time a new beta build comes out, so if you have an exported project you might want to delete the libs (.a files) so that Xcode is forced to download fresh ones.

#LuaSocket#

Codea 2.3 (37) includes LuaSocket. These are the socket and mime global tables.

The plan is to keep these in Codea for future internal developments (e.g., debugger), but they should be available for you to use in your projects. I do not really like the socket API, and I don’t think it fits well with Codea, so I don’t plan to include documentation. You can find the documentation online.

@Simeon - thanks. Just to confirm, I’ve just picked up the new build and i got the request to update the examples and ‘Anagrams’ worked out of the box.

Also the fix to updating of WIDTH & HEIGHT appears to work correctly as well :slight_smile: :slight_smile:

@Simeon Not sure what you changed for 2.3(37), but I ran my above speed test and the average time from the editor was 8.39 and the average time for replay was 8.62. Both averages were for 10 runs each. The run from the editor was a large decrease in time and the run from replay was also a decrease in time.

Parameter and Speakeasy demos still fail on this version. Cargobot now works.

@Simeon Not sure if this was mentioned or if this is really a problem, just not what I expected. This code draws a circle in Landscape mode. If the ipad is in portrait orientation when the code starts, an ellipse is drawn. When rotated to landscape, it flips to the circle.

supportedOrientations(LANDSCAPE_ANY)

function setup()
end

function draw()
    background(40, 40, 50)
    fill(255)
    ellipse(WIDTH/2,HEIGHT/2,300)
end

@andymac3d any info on how they fail for you? They work for me. Do they fail for anyone else?

@dave1707 great find, thank you, I think this relates to the settable WIDTH / HEIGHT change I made to fix @TechDojo’s issue.

I’m not sure why the speed has increased, there weren’t any performance related changes made.

@Simeon For the Parameter demo, the print for the X value as you move the slider prints a long number, whereas on the slider it’s 2 digits past the decimal point. That’s the only thing I can see that might be wrong.

LuaSocket, so great!!! grrr a ton of work and no time to test. Also it seem that sometimes the ip binding from a tcp fail (to the default 0.0.0.0). Thank’s a lot for this addition!

@Simeon - appears it was ‘operator error’ on my part. I’d inadvertently modified those demos previously whilst looking at something else.

However, I’m sure the ‘old’ Codea behaviour a number of iterations ago was that changes to the demos were never saved? I think it might be easier to encourage people to duplicate the demos before modifying them else beginners could easily mess them up ( like what I just did :slight_smile: )

Also, is there a way of copying the contents of the output pane? Something like: output.copy (that then copies it to the clipboard) - it occurred to me this would be useful for debugging.

@andymac3d - touch an entry of the output pane and it will be copied to the clipboard, an other solution could be overriding the print function?