Code Out of Functions

Hey, CayDay47 is back.

Just something I noticed - and may have missed - is that I am no longer able to establish settings such as rectMode() and spriteMode() out side of a function in the newer updates of Codea, such as 2.1, like this:

-- Test

rectMode(RADIUS)
spriteMode(RADIUS)

function setup()

end

-- and etc.

All my projects were now “halved”, such as everything halved in size and etc.

Another note is that although settings such as those mentioned above are disabled in this way, displayMode() continues to work in this fashion.

Was this intentionally planned?

I noticed it too… It’s something with the threaded renderer, I think. Those functions require an OpenGL frame, which are only created around setup().

Should we have to change our code to fit this, or will the dev team sort it out soon? Because there’s normally a long way between updates.

@CayDay47 - the simple way to fix this is just wrap a Settings function around these settings and call it from setup.

I wouldn’t wait for an update unless you know for sure it will be fixed soon.