It appears that when extend-box-horizontal or extend-box-vertical are both 0 the vTex coordinates are on the sprite, where the origin is the bottom-left corner of the sprite. But when either is non-zero then the coordinates are on the screen, where the origin is the bottom-left corner of the screen.
The issue is if we wanted to scale from the center of the sprite we'd need to find the vTex coordinate of the center of the sprite, and I haven't seen any example of this in the plugins. Looking at some of the radial effects you can use the center of of either the object or screen, depending on what the vTex's are on, but it's not helpful if we want the center of the object when the vTex is on the screen.
Trying to see what we have to work with, here are some of the variables that C2 provides for shaders (from glwrap.js):
pixelWidth;
pixelHeight;
destStartX;
destStartY;
destEndX;
destEndY;
layerScale;
layerAngle;
viewOriginLeft
viewOriginTop
Poking around glwarp.js there seem to a couple more, like samplerFront, vTex...
Also built in to glsl you have these:
https://www.opengl.org/wiki/Built-in_Va ... der_inputs
The bottom-left is always (0,0) and the top-right is always (1,1).
You can calculate the width in pixels with 1.0/pixelWidth, the height can be calculated in a similar way.
Interesting, but nothing really helpful. The only solution I can think of would be to add two more parameters for the center x and y and set them every tick. Then the math would be something like (x-center)*scale+center.