How to center text compared to the other two layers

Hello world

It seems simple enough: I have two layers of distinct text - both in the same line. One is left-aligned, the other is aligned to the right, so that they specify in the middle. Overall, I want they to be centered.

Example.PNG

But because these two texts will have different formulations of various projects, I want to use the model function, so I can edit them in first.

Is there a way to tell After Effects: "some text there, take two text layers and their Center as a whole."?

For the life of me I can't figure out how to do. The closest I am to a solution is an expression on the anchor to a null object, which reads:

W1 = thisComp.layer("Text1").sourceRectAtTime () .width;

W2 = thisComp.layer("Text2").sourceRectAtTime () .width;

[(thisComp.width-(w1 + w2)) / 2, value [1]]

Then the text layers are related to the null value.

I found this in a post on Creative Cow: multiple text layers to form one. how I can it Center as a whole?: Adobe after effects Expressions

The problem with that: it works with the text aligned to the right. If you change the text aligned to the left, everything goes to the left.

Does anyone have an idea how to make this work? It may even be a way simpler than using expressions?

I hope I could explain the problem. If there's anything missing please let me know.

Thank you!

Concerning

FABI

There is no demo that is involved in the technique. Alignment tools will not work with a demo. In the screenshot at the top of the page, note the selected text and the reference level setting in the character Panel. I just adjusted the base line in the second paragraph of the text to move it to the top so that it is aligned with the base line in the first paragraph of the text.

Unfortunately, the process becomes a little more difficult if you want to be able to use this model as an asset of editable text dynamically linked in Premiere Pro. Centering becomes a problem. It's pretty easy to get the width of the text layer but the anchor is based on paragraph and I'm not in any way take the width of the first paragraph of the text and add it to the width of the second paragraph of the text and adjust the anchor point to be at the center of the paragraphs combined.

You can return to the idea of two layers of text, but use the width of each layer and the ratio between the widths to control the position of a null value. If you then related the two layers for the null value, the null value of centering with an expression based on the width of two layers and the ratio between the width of the left and right text would do the trick. I have to think about how to write this expression a bit. This is probably the solution to your problem, but I don't think I could write this expression in my head.

What you want to do is to calculate the total width of the two layers (tw) and then calculate the ratio between the width of the two layers (rw / lw) then multiply the width of the layer left by the ratio then you can calculate the offset. You may have to calculate the ratio of the layer from left to the total width of the two layers. As I said, I'll have to think for a minute. There is also the problem of the space between the two layers. You will need to add a space before the first letter of the right text layer, but the size of the right layer won't take into account the space so you have to measure it and add it to keep things perfectly centered.

EDIT:

So I did a reflection more and I was doing it too hard. All you have to do is to calculate the difference between the width of the layers both text and divide by 2 and add it to the Center comp. name your layers of text left and right, and then add this expression to a null value.

r = thisComp.layer ("right Text") .sourceRectAtTime (time, false);

R.width = RT;

l = thisComp.layer ("left Text") .sourceRectAtTime (time, false);

lt = l.width;

CC = thisComp.width/2;

DIF = (lt - rt) / 2;

[dif + cc, value [1]]

Now, hold down the SHIFT key and parent the two lines of text to null. If you don't want to use the trick of null, you can add the expression of two layers of text. Using the value null makes it easier to move. The expression can also be modified to allow you to position the null or layers wherever you want in the model.

Tags: After Effects

Similar Questions

  • How to make a form field validate that it is the sum of the other two fields?

    Hello

    I'm creating a form, and I'd like one of the fields to validate by making sure that this field is the sum of the other two fields of the form.  Anyone have any ideas on how to go about it?  I know that I need to run a custom validation script, but I don't know where to start - I have never made one for before validation.

    Thanks for any help!

    OK, here's a sample script that I hope will clearly demonstrate the general approach. It is intended to be the validation script custom field that the user enters the value which is supposed to be equal to the sum of the other two.

    Custom validation script

    (function () {}

    Get the value that the user entered

    sVal var = event.value;

    If it is empty, do nothing else

    If (! sVal) {}

    return;

    }

    Converts a string to a number

    nVal = + sVal;

    Get the values of the fields in the form of numbers

    var v1 = + getField("text1").value;

    var v2 = + getField("text2").value;

    Add them together, rounded to two decimals, converting to the number

    var sum = + util.printf ("%.2f", v1 + v2);

    Compare the value of the sum of the other two fields

    Change the user if they do not match

    If (nVal! == $) {}

    App.Alert ("the value entered does not equal to the sum of text1 and text2. Please correct. «, 3) ;

    If you want the value entered was rejected, include the following

    Event.RC = false;

    }

    })();

    Replace "text1" and "text2" with real field names.

  • I have just re installed Windows XP. Windows installed after three attempts. When I turn on the computer there are three choices of Windows XP. Only the first works how to remove the other two?

    I have just re installed Windows XP. Windows installed after three attempts. When I turn on the computer there are three choices of Windows XP. Only the first works how to remove the other two?

    I have a hard drive. At least two partitions. C: 74.7 GB with 63.3 freespace
    D: 74.2 GB with 70.6 freespace
    These are my original specifications of the hard drive: 160 GB (7200 RPM) SERIAL ATA HARD DRIVE WI
    So I suspect there are at least one or more partitions hidden leaving 11.1 GB for hidden partitions!
    Windows is present on both drives C: & D:. In the directory windows on C:, the oldest entry is 19.12.12, 21.43 last 21.12.12, 22.50
    The first entry in the directory windows on D: is 19.12.12, 18.42 the last 21.12.12, 22.40
    I hope that makes sense to someone, any help gratefully received!

    As long as you have verified you dΘmarrez done on the c: / partition, Yes, you can reformat the drive D: / partition using Windows 'disk management '.

    J W Stuart: http://www.pagestart.com

  • Drive on which Windows XP to reside is always labeled as a system drive. How can I make one of the other disks that has Vista or 7 that the new system?

    Change the system drive

    I'll try to explain my situation better than I can.

    My situation is that when I used to have XP installed, I had installed the only drive I had back then which is now the drive D, for a long time, so I have Windows Vista Home Premium 32-bit, Windows 7 Home Premium 32 bit installed on two different discs, Vista is installed on drive C and 7 is installed on drive E , but I don't have XP that I had managed to get rid of it.

    My problem is that the drive on which Windows XP to reside has always left this disc marked as system in the disk management window, and I was wondering how to do that one of the other readers who has Vista or 7 that the new system?

    I already managed to change the startup disk from drive where Vista is installed to, it's just that I need to change the disk that is marked as system to another drive, such as D drive begins to show signs that it comes at the end of his life and I would like to move the startup folder as well as the other files needed to start on the other.

    I assume that you installed Windows XP 1, then Vista, 7 (these 2 OS not in order)?

    And Vista and 7 was by all means upgrade installation?

    Since originally, that you have installed Windows XP on drive D, it should be marked as 'system' and retains so the tag 'system '.

    The volume of the 'system' should be identified as the first primary partition active. It may or may not have the files it contains.

    The fact that the system considers "system drive" does not mean that there are files that it contains.

    Now, you want to delete the existing volume and create a new volume. Needs to be done outside the facility.
    When you start the cd or DVD to start the installation list us readers, if you remove the volume the volume drive letter is already booked, so you get the next available drive letter, do not re-use the deleted volume drive letter.

    If he removed during installation and then recreated as a new volume (formatting does not remove the volume, you need to delete the volume and recreate it)

    -[Posted by Darrell Gorter [MSFT] in another forum.]

    Try to format the XP partition and change the drive letter.

  • Media Center Question can I have set up as a server and the other two as clients, each using two of the tuners of the card?

    I have 3 computers running Windows 7 Professional, one of them has a four installed tuner DVB - s2 card. I want to configure it as a server and the other two as clients, each using two of the tuners of the card. I understand the media library is able to use the basic network TV tuning cards, so there must be some way for me to configure the server to send the information over the network.

    Any ideas?

    On Fri, September 19, 2014 12:28:56 + 0000, SamJ008 wrote:
     
    > I have 3 computers running Windows 7 Professional, one of them has a four installed tuner DVB - s2 card. I want to configure it as a server and the other two as clients, each using two of the tuners of the card. I understand the media library is able to use the basic network TV tuning cards, so there must be some way for me to configure the server to send the information over the network.
    >>
    >>
    >>
    > Any ideas
     
     
    Start reading here
     
    You will not be able to use your existing tuners like tuner network. Microsoft has
    arrested development of Media Center, so don't expect any new hardware/software to
    appear.
     
     
     
    __________________________________________________________________________________________________
    Barb
    MVP Windows Entertainment and connected home
     
    Please mark as answer if that answers your question
     
     
     
  • Common cause of failure of the Mirage server in clustered environment and how customers will be switched to the other server in a cluster

    Hello

    Can someone share me information about common cause of failure of the Mirage server in clustered environment.

    And how customers will be switched to the other server in a cluster to continue their operations from the server failed.

    Kind regards

    C Bathesha

    In general, Mirage servers are not lacking. It is very rare (and not, for example, to problems of storage or endpoitns, which are more common).

    May raise problems of overload, memory or hardware malfunction too little.

    After that you make server standard troubleshooting (the etc system event log), you must file a Service request by VMware.

  • Using FF 35.0.1 on three devices, one of them shows the new synchronization, the other two show an old, so what's the problem?

    I have Firefox on three systems using sync to keep them in line. All have been updated to 35.0.1, however, only a new sync watch, the other two show the synchronization of the former. The new synchronization version runs on Win7, the other two move on Win7 and Win8-systems. What can be wrong?

    Finally got round to then separate connection for the synchronization service, and it worked.

  • How can I get the Extension toolbar icon to display the image without text (without affecting the other icons universally)? How can I change the text of the icons (except space)?

    «In the drop-down view menu, you can choose what to display toolbars: icons, text, or icons and text together.» By default, Firefox shows icons only. "Is it possible to choose a setting for a specific toolbar icon to be icon only (no text) without affecting all the other icons on the toolbars universally?

    Second, is there a way to edit the text on a toolbar button by another extension (because it takes up too much horizontal space in the toolbar because of the amount of text)? I do not know how to locate the xpi file and open it with Notepad, but then it is mainly (not English) code & FIND is not to search the text of the button (to change).

    These 2 questions should apply to the buttons of the Extension in general. However IF it makes a difference I'm talking for the toolbar button back to 7.0 top of the page that says 'Go to top/bottom '. I would like to at least change on "Go to", but my questions also apply to the other buttons Extension. I realize that it may be necessary to redo a fix/change whenever there is an update? Thank you.

    You should always see this icon that only the text of the label could be hidden.

    You can try this code in the file userChrome.css below default @namespace.

    @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    
    toolbar[mode="full"] #b2tTBUnicon { min-width:0px !important; }
    toolbar[mode="full"] #b2tTBUnicon .toolbarbutton-icon { margin-top:-20px !important; }
    toolbar[mode="full"] #b2tTBUnicon .toolbarbutton-text { display:none !important; }
    
  • I have two text fields, where the user will sign a text field and the other text field should be mandatory

    I have 2 text fields, and how can I do a condition when the text 1 field is entered, then they must enter data into the text field 2.  I know it seemed simple, but I'm just a beginner in this... Thanks in advance!

    Hello

    I'm sorry, I forgot this matter.

    Please try this code...

    If (this.isNull)

    {

    TextField2.validate.nullTest = 'error ';

    }

    on the other

    {

    TextField2.validate.nullTest = "disabled";

    }

    Hope than that,

    S, candy.

  • How to disable a checkbox when the other is checked

    Hi, I'm a first time user.

    I am doing dissapaer and strips of text fields when the boxes are checked. but only alow a box to be active at the same time.

    I do a simple form in Acrobat 9 pro.

    I have two checkboxes Checkbox1 and Checkbox2.

    I have two text Textfield1 and Textfield2 fields

    I added shares to checkbox1 and checkbox2 to "hide or show" text fields.

    Action-> on focus (checkbox1) show/hide field (textfield1) is hide

    Action-> on focus (checkbox1) show/hide field (textfield2) is to Show

    Oposite

    Action-> on focus (checkbox2) show/hide field (textfield2) is hide

    Action-> on focus (checkbox2) show/hide field (textfield1) is to Show

    problem 1 - how to disable checkbox1 when the 2 checkbox is checked.

    or disable checkbox2 when checkbox1 is checked.

    my other problem is that this action has the same effect for checking or unchecking the box.

    Thanks in advance to anyone who can help you.

    can you please write your answer in simple terms. Basically, it's the first time I've used acrobat pro so please do not assume that no matter what knowledge at all. Thank you very much.

    First of all, I experience a few boxes to tick, and learn their properties and how they interact.

    Have you tried to use the same name for 2 checkboxes and assign one other "export value" for each checkbox.

    Have you looked at the values a check box or boxes have when checked or unchecked?

    Have you looked at how to work the various actions for a field?

  • place text from the text field to the other in a subform of livecycle

    Hi all

    I have a dynamic form created in Adobe Livecycle Designer ES, which contains several subforms positioned inside a fluid page. I want to have two fields of text inside one of the subforms so that the text entered in the first field of text (not expandable) will continue in the text field (which is a repeating field). I know that there is a script inside of Acrobat that will do, but may not know how to write a JavaScript for the form in livecycle designer.

    The two fields serve as stand-alones without problem, but not as described above.

    (Here's the script Acrobat XI, which doesn't work for in livecycle, but give an idea of what I'm trying to do):

    Action: Triggered on mouse towards the top/run menu

    / * belongs to: AcroForm:textfield1:Keystroke * /.

    If (event.fieldFull | event.willCommit)

    this.getField("textfield2").setFocus ();

    < / ACRO_script >

    < / AcroForm >

    Is there a corresponding JavaScript for livecycle? Thanks for your suggestions!

    Hello

    You can use the full event here for the length text box that is set. So to write the following code in the complete event of a text field whose length is fixed.

    xfa.host.setFocus (the text field whose length is not fixed)

    Thank you

    Sidonie.

  • How to update text or change the text in the TLF?

    Hello

    I can't update the text in a TLF. This should be pretty basic, but forget something.

    It's the pseudocode:

    pg_xml = new XML(str);
    textFlow = TextConverter.importToFlow(pg_xml, TextConverter.TEXT_LAYOUT_FORMAT);
    var tlf_sp = new Sprite();
    textFlow.flowComposer.addController(new ContainerController(tlf_sp, width, height));
    tlf_sp.x = posx;
    tlf_sp.y = posy;
    textFlow.flowComposer.updateAllControllers();
    addChild(tlf_sp);
    

    Elsewhere, the text should be updated:

    pg_xml = new XML(str);
    textFlow = TextConverter.importToFlow(pg_xml, TextConverter.TEXT_LAYOUT_FORMAT);
    //TODO: figure out how to update text! updateAllControllers doesn't work.
    //textFlow.flowComposer.compose(); //-- Didn't work.
    //textFlow.flowComposer.updateAllContainers(); //-- Though this couldn't be used, I was just trying out, but didn't work either.
    textFlow.flowComposer.updateAllControllers();
    

    Version TLF: 4.0.0.13895

    I just need to update the content of a TLF, rather than recreating a new textflow. Any help will be much appreciated.

    Kind regards

    Sabine

    If you are importing, the import process always produces a new TextFlow. You cannot import into an existing TextFlow.

    Gordon Smith

    Adobe Flex SDK team

  • Online banking site now displays the page of connection in text alone; on the other computer it always shows the page with images and clickable - is - it a solution?

    Previously when I logged my INGdirect Bank online account, the window connection come showing images and clickable hotspots. Window connection changed recently, to a text only version. On two different computers using Firefox, the connection returns to the previous version, with images and clickable hotspots. I do not know to have done anything to change my settings in Firefox or on the website of the Bank. Because it seems to be located on this computer, I tried to download the latest version of Firefox, but didn't get any change, connection always comes back to the text-only format.

    Try to clear your browser's cache.

    Tools > clear recent history... - details and of course Cache hit only is selected, and then select all and click the clear now button.

  • NB100: Line-In/Mic-In - how to pass from one to the other?

    Hi everyone - lists of specifications more list entry on the NB100 as an audio Mic-In/Line-In, but I can't find an option to go to the line.
    I would like to be able to record audio with an external preamplifier, therefore the Line-In input, would be really useful.

    Is it just the input that is activated when enabling/disabling gain/sensitivity between Mic-In/Line-In?

    The Mic-In volume would be the same as the change of Line-In?

    Any ideas?

    Thanks in advance :)

    Hello

    In your case you should take a look in the user manual.
    The user manual says that this laptop supports and taken headphone and Microphone jack.

    The mic jack is a standard 3.5 mm jack, and it allows the connection of a microphone or the other device to an audio input.
    This means that you do not need to change anything. Simply plug the connector of right to take.

    Good bye

  • How to center an image in the tab on the front control in LabVIEW 10 (Mac Version)?

    Hello

    I would like to center an image on the front panel. The image is on a tab control that is suitable to the pane. I can't find a way. I work with LabVIEW 10 on Mac. Any suggestions would be very much appreciated.

    Thank you

    Michelle

    You will need to do a bit of math.  Download the locations of the edges of the tab control and image control.  The centers are unlike most high or left half.  I'm not sure without checking, but I think that the values are with respect to the angle of the screen.  Be careful about the origin if you have several displays.  If the differences are odd, you have an error of half of the pixels.  From the positions of the centers, you work towards the positions of the top and left edges.  It may take a few tries.  The rectangle Bounds includes the label (I think), so keep that in mind also.

    Lynn

Maybe you are looking for