Graphics

 View Only
  • 1.  horizontally centering a group based on longest line of type

    Posted 11-21-2019 17:46

    Hi all,

    I am trying to horizontally center a group on x which contains a quad with clip texture, and 2 rows of text left justified to the quad.I want the centering to be based on the longest row of type.  I think this should be possible in visual logic...but I am new to it. I tried to do a bounding box width and divide by 2 to output x position, but this did not work on the group nor a single text line. I must have done something wrong. I didn't even get to try to figure out how determine which line is longest. Any ideas?

    Thanks so much for your help,

    Layne



  • 2.  RE: horizontally centering a group based on longest line of type

    Posted 11-21-2019 20:54

    Could you please give us more details?...

    In Visual Logic get the maximum value form both Bounding box width.
    By default centered object in group have X-Position = 0
    Divide the longest text in 2, divide it with -1 to get the negative copy and apply it as a Position X for Text 1 and Text 2.


    #XPression


  • 3.  RE: horizontally centering a group based on longest line of type

    Posted 11-21-2019 22:15

    I am not sure what details you are asking for Rosca. I am going to try what you said, and then use the new x position for the quad with a negative x offset to line it up.  Thank you for your help.


    #XPression


  • 4.  RE: horizontally centering a group based on longest line of type

    Posted 11-21-2019 23:30

    The visual logic provided worked really well, but it didn't exactly center. It is a little bit to the left, but everything moves when I change the amount of letters in each row. I am going to try to offset the x position of the type and see if that helps. Thanks again!


    #XPression


  • 5.  RE: horizontally centering a group based on longest line of type

    Posted 11-22-2019 00:52

    OK. So I added the offset to get everything to center correctly and all is good. One issue is that I would like to use auto squeeze, but when I turn it on, it does not work properly. I think I have to make a delimiter to say if you reach this width...stop moving the x  position. I saw something like this on the forum, but couldn't exactly figure it out. Any suggestions?


    #XPression


  • 6.  RE: horizontally centering a group based on longest line of type

    Posted 11-22-2019 05:29

    Fill the text with multiple XXXX until your reach preferred width, than click on "Set The Current" and enable Auto Squeeze.


    #XPression


  • 7.  RE: horizontally centering a group based on longest line of type

    Posted 11-22-2019 07:36


  • 8.  RE: horizontally centering a group based on longest line of type

    Posted 11-23-2019 00:33

    Thanks again Rosca. I know how to use auto squeeze, but when I applied it to my text, the visual logic stopped working. Thanks to Drew Shealy who suggested I use the boundingbox.widthscaled visual logic blocks instead of the normal bounding box.width. This takes into account the auto squeeze.


    #XPression