CoronaContentScale
is an application-wide property, initialized at the start of each frame.
It’s used to compute the CoronaTexelSize
properties, details here. Those are updated if the texture changes, not the geometry, so aren’t per-rect. (Changes like this mean separate draw calls, which would be too expensive in the general case for each display object.)
What follows is some food for thought, but probably not immediately useful.
We synced these features in build 3713. (Still need to investigate this issue and squash this bug.)
There are a lot of things in there and I need to get on the docs and all that.
(I have a bunch of material in rough form at the API level, between the PRs and some local files. However, Solar’s vertex format, flow of control, etc. need documenting: I assumed nobody was going to completely rewrite the engine at this point, and designed with that in mind, promoting some of these former “implementation” details in the process.)
“Automatically” calculating a property, like Aspect_Y
in your case, is something I’ve considered a lot. (In my case, often it’s about finding the center of a spritesheet frame, either the position or the texture coordinate, in order to do effects based on x and y positions between 0 and 1.)
The “effect data type” feature, demonstrated in the example with the boxes moving up and down, might be a way of achieving this. It’s a bit like a geometry shader, but outside the rendering pipeline.
I mentioned “An effect data type is something you will only see on the C++ side.” when describing them. This is obviously an awkward restriction and definitely not friendly to experimentation, and I’ve been considering ways to open this up. For speed reasons it isn’t ideal to do these things in Lua—they might operate on huge batches of vertices—but that’s no reason to outright forbid it.
The more difficult issue is that events like this happen outside “enterFrame” / timers / etc. context, once everything’s ready to go, so it’s assumed you’re done calling Solar APIs and manipulating display objects. There could be a “DON’T USE THOSE!” caveat on this kind of Lua code, but that would be a very easy policy to break, so it’s probably best to sandbox these bits in separate Lua universes.