Suggestion for styling

All - here is a little demo, showing the effect of defined styles (here held in Class defs) on text, rectangles and ellipses. It’s just a toy to demonstrate how you can reduce the clutter in the draw() function and would be better built into Codea - not necessarily as I have set it up, there are probably much better ways to do this. Anyway - have a play.

@Bri_G if you have iOS 15 then it will run on your device. It uses metal and a better rendering/shader system so it’ll at least run as well if not better than the existing runtime

Your style formatter looks interesting. What we could potentially do is let you create style objects and pass them as a first argument to the graphics commands as an optional overload that uses that style. That way you can save a bunch of styles (or even save them as json files) which could be re-used whenever. All the same old style state would still work it’d just be an additional option

@dave1707 as I said, you can still just put one statement per line, or use the legacy versions. The intent is to clean up the API namespace to make room for future additions without clogging it all up

@RonJeffries The inconsistency between . and : does bother me but the main reason for it is, one returns a new object (a tween) and the other is just returning the namespace. I could make it use : syntax for both, but for some reason that felt like a cludge to me…

@John I’ve been thru many Codea changes. I’m sure once those come out I’ll be using them. It will seem strange in the beginning, but after awhile it will be normal.