Help vertically centering multiple layers of text
I want to dynamically center multiple (three, in this case) text layers as if they were one block, so no matter which of the three changes size (more text or font size change) the layers are, as one unit, centered vertically together. This is to be used with essential graphics, so it needs to be procedural. Also, this is text LAYERS, not just multiple-line text boxes (although this should accommodate the layers whether or not they have multiple lines).
I have no problem centering (or bottom- or top-aligning) individual layers using sourceRectAtTime(). I center the middle layer's anchor point and, using the various layers' heights and tops I align the top and bottom layers relative to the center. All is good, they behave nicely together--now I just want the lot of them centered on the screen/in the comp.
I'm thinking the way to go would be to parent the middle layer (because the top and bottom layers are relative to it) to a null, and somehow move the null's anchor point relative to the entire text block's height (top.height + mid.height + bottom.height) and then move it's position to the screen center. I don't know why, but my brain seizes up doing this.
Any help is appreciated!
