-
Tracking a shape layer along edge from of a .sourceRectAtTime rectangle
Hi! Another expression question that I’m hoping someone can help with. ????
I am trying to create a template for a series of titles. The idea is that theres a cursor on screen that “highlights” the text, similar to how you would highlight a string of text on a webpage to copy/look-up/etc by dragging the mouse over the selection. We will do many variations of the length of text, so I want to streamline this one specific animation action to always move from corner to corner without needing to adjust position keyframes.
Currently, I’m working with the line of text and using sourceRectAtTime to create a box with padding behind the line of text. I used this tutorial: this tutorial to build my growing/shrinking box with text. What I want to do now is have a “cursor” (I’ve built this as a shape layer) start at the bottom left corner of the box and then slide across to the bottom right corner of the box. This cursor will have a matte attached that reveals the text/box combo.
Essentially it will do this:
1.
2.
3.
I can get the wipe to work fine by adjusting the x-scale of the rectangle, but where I’m stumped is figuring out how to connect my cursor to this action. My thoughts are if I can find these two points on the X-axis (bottom left corner and bottom right corner) of my rectangle and designate those two points as in/out points for my “cursor”, it might be possible to set LEFT as 0% and RIGHT as 100% and use a slider to keyframe the animation timing. Can I create a path that is only the bottom edge of the image and parent the cursor to the path?? What expression do I use to find the position of the two corners of the rectangle??
Keep in mind, this will need to work with varying widths of the rectangle since the text will vary in length for each title. Any help would be greatly appreciated!! Thank you!