I didn’t expect this topic to get so much attention
@RonJeffries so the main rationale behind the proposed change was indeed trying to reduce namespace polution. I’m a fan of fluent syntax, but I can see it’s not for everyone. I tend to do the following:
style.push()
.fill(255)
.strokeWidth(5)
.stroke(255, 255, 255, 128)
There’s also the possibility of just writing the style.fill(255)
etc… on each new line. Any time you see a color argument you can give it a color object or any of the standard overloads (i.e. grayscale, rgb, rgba, grayscale+alpha)
As for getting style values I just assumed you wouldn’t really be trying to get multiple ones so passing zero parameters causes it to return the style value rather than the the style table/namespace. It seemed like the most sensible thing to do.
I was trying to be consistent with this new syntax, so I’ve been playing with matrix.push()
and context.push()
as well.
I’m also working on stuff like require 'legacy'
for compatibility with older projects.
As for timelines, I’ve been out of commission for the last month, which has delayed the project. Once the IDE is compatible with Codea 4 and is useable, we will immediately go into early beta and all you guys can start playing with it so we can get feedback and suggestions.
I’m also looking into having a dedicated Library
folder like Shade has for adding user extensions to Codea, that will function globally. The new class bindings also supports this, so as an example I’ve already done the following when playing around with the new editor:
-- Entity class extensions
function entity:placementWobble(duration, spinCount, tiltAngle, height)
local scn = self.scene
local y = self.y
self.y = y + height
scn:tween(self):to{y = y}:time(duration * 0.75):ease(tween.bounceOut):unscaled()
local up = vec3(0,1,0)
local right = vec3(1,0,0)
scn:tween{t = 0}:to{t = 1}:time(duration):ease(tween.circularIn):unscaled():onStep(function(tween, t)
local t2 = 1.0 - t
local dir = quat.angleAxis(tiltAngle * t2, right) * up
local dir2 = quat.angleAxis(t * spinCount * 360.0, up) * dir
self.rotation = quat.fromToRotation(vec3(0,1,0), dir2.normalized)
end)
end
Yes, the new tween system is also fluent. I can’t help myself 
So if people wanted to just add new methods to existing built-in types, this will be possible. Making Codea a bit more flexible. This will also work with shaders, so you can #include
something from the library, the project or even a lua function that lives in the shader and dynamically generates code.
I know it’s extremely slow going at the moment, so I hope it’ll be worth it for you guys