I have this design. Now I'm trying to have the red box autosize in width too the two clubs. So for example if the game would be PSV - ADO the red bar would be shorter. I guess shape position X axsis should scale up to X end from the last team. But not sure if that is possible?
Who is Team1 vs Team2 has the sourcetext pulled from a json file.
Allready got the position from the second team fixed to the first team. gap = 50;
L = thisComp.layer("01_firstname");
r = L.sourceRectAtTime(time,false);
hisRight = L.position + (r.left + r.width - L.anchorPoint)*L.scale/100;
r = sourceRectAtTime(time,false);
myLeft = position + (r.left - anchorPoint)*scale/100;
delta = hisRight - myLeft;
value + delta + gap