@dave1707 it allows you to access the system font like this:
The system font is “special” in that it’s really two fonts which are selected based on the current point size. This is how iOS renders text throughout its UI. So these strings let you mimic that behaviour.
I’m thinking of using exposing constants for these strings and putting them in the font picker properly. But for now you can use the strings directly.
Layout just gives you access to information about the safe area and size class.
So if you do this:
function sizeChanged(w, h)
if layout.horizontal == layout.COMPACT then
print("Using compact layout")
print("Using regular layout")
It should print that you’re using compact if you invoke split view and make the Codea portion of the screen small enough (depending on iPad model).
This is how most iOS apps decide when to change their layout characteristics. So I thought exposing it to Codea would be good too.
@Simeon Can you give an example of the System Font Support. I can’t get it to work so I probably don’t understand the changes.
The Froggy example works OK. You have to do Restore Examples for the changes to take affect.
The sizeChanged works OK.
I haven’t figured out the Layout module yet. Tried split screen, but no luck yet.
PS. I guess the iPad doesn’t have any safe areas.
On safe areas it mostly applies to the iPhone X style devices and the latest iPads (for the on-screen home indicator at the bottom of the screen).
@Simeon Thanks. I was totally trying to use the THIN, BOLD, HEAVY, etc wrong. As for the safe areas, I figured it wasn’t for my iPads.
Codea 2.6.3 (138)
The OSC code seems to work. Now to try linking 2 ipad together.
PS. No trouble at all sending messages to another iPad and see them there.
@Simeon Is there a max size of the message being sent for OSC.
@dave1707 I don’t know, that’s a really good question. I’m going to have to look into the spec now.
Thank you for trying it out so fast. Is the API reasonably easy to use? Would you make any changes to it?
Here’s an example using OSC. Load this on both iPads and fill in the iPad address of the other iPad. Start both programs and slide your finger around the screen. The sprite on the other iPad will move.
@Simeon It seems really easy to use. I’ll have to play with it more to see if it needs changes. So far I don’t think so.
host = osc.start() -- address of this ipad
osc.host = "192.168.254.15" -- put address of other ipad here
sprite("Planet Cute:Character Horn Girl",x,y)
function osc.listen(address, ...)
if t.state==MOVING then
@Simeon Something weird going on. If I have airplane mode on and run the above code on my iPad Pro, Codea crashes. On my iPad Air, it doesn’t and prints the host iPad address.
Oh that’s an awesome little example!
Thanks for finding the crash, I’ll make sure I debug in airplane mode tonight.
@Simeon This has probably existed in all the releases, but it probably needs fixing. If I enter something in
name and press
print name, I print the name in between two *. If I press
clear name, the name is cleared because when I press
print name, there isn’t anything between the *. But the name field isn’t cleared and I have to press backspace to clear the text area. Or is there some way to clear that area that I’m overlooking.
background(40, 40, 50)
@Simeon - trivial issue but I find the error message produced above the new project name field, when there is an existing file of that name, is small and difficult to see against a dark background. A brighter colour may show up better.
Also, this may be just me, but I find sometimes when I have just edited something (usually inside brackets) like changing a value and trying to run it gives an error and the edit has disappeared. It’s happened several times but not consistently.
@Bri_G I agree about that, it’s a leftover from the very first version of Codea which didn’t even have complicated backgrounds.
I’ll try to reproduce the second issue by editing/running very fast. Perhaps the autosave hadn’t kicked in before the run command hit and it somehow used the old version.