Graphics

 View Only
  • 1.  Justifying 2 text objects as one

    Posted 07-16-2018 23:22
    Yes, that is confusing.. let me try to explain... I have a page with stats, category first, and then the actual stat itself, such as HEIGHT: 6-5 Obviously, these have to be 2 separate text fields, and in order for them to not collide, I have the category text Right justified, and the Stat text Left justified, but collectively, I need the pair to stay centered within the field, as if it were a single piece of center justified text. I'm sure there is a VL rig that will do it.. some manner of adding the bounding box width scaled values together and dividing it by something and feeding that to Position X of their Group Object parent... but I am having trouble riddling it out, so I turn to you, as I am sure I am not the first up this particular mountain.

    Cheers
    - Willie


  • 2.  RE: Justifying 2 text objects as one

    Posted 07-17-2018 03:32
    I would use Visual Logic and add the two data fields together using a Concatenate string that also has a string value added into the middle of the data fields that adds the correct spacing between them. This Concatenate block would then output to a separate text object that can be set to center align.
    #XPression


  • 3.  RE: Justifying 2 text objects as one

    Posted 07-17-2018 16:45
    That's fascinating. I only just used concatenate for the first time yesterday to set up some dynamic font resizing - actually in the same project I am referencing here. I'll have a play with it today and see if I can suss out how that works exactly. Thanks!
    #XPression


  • 4.  RE: Justifying 2 text objects as one

    Posted 07-23-2018 18:57
    I would use Visual Logic and add the two data fields together using a Concatenate string that also has a string value added into the middle of the data fields that adds the correct spacing between them. This Concatenate block would then output to a separate text object that can be set to center align.



    So, i got about 99% there, successfully joining 2 texts into one with center justification in a quick test scene I made, but I am unsure where to insert the 'string value' to determine the correct space between the 2 fields. Making a string value block with a value of 10 (for example), and attaching it to the concatenate block just inserts text with the number 10 into the combined text object.. which makes sense that it would... So, what I did was add a third text object center justified, right between the other 2 and just put 2 spaces in it. This seems to output correctly, BUT if I change the text in either of the 2 linked text objects, the center justified text object is not acting like it is center justified, shifting to one side or another depending on which feeder text object is changing, so clearly I'm not doing something right. I have attached the simple test scene, if someone can take a look and guide me to the solution, I would be forever grateful.

    Cheers
    - Willie

    Well, blergh... the scene comprised of 4 text objects and 4 logic blocks with 0 materials is somehow clocking in at 1.86 MB, which us tiny, but too large apparently to attach here based on the error message I get when I tried... sigh... I'd still appreciate any advice that could be offered. It seems like a fairly common sort of thing to do
    #XPression


  • 5.  RE: Justifying 2 text objects as one

    Posted 07-24-2018 08:16

    In your string value block put spaces into the value, and not the string "10" .
    Concatenate block takes all strings input and write them one after another to generate a single string.


    You can also put the spaces in the Delimiter parameter of the "Concatenate" block and avoid the string value block : the text in "delimiter" will be added between all string inputs



    See project attached : [ATTACH]n16678[/ATTACH]

    Scene1 : with 2 texts
    Scene2 : with more than 2 texts to better understand how concatenate and delimiter works.

    Hope it helps.


    #XPression


  • 6.  RE: Justifying 2 text objects as one

    Posted 07-24-2018 17:52
    Thanks A, that did help. I didn't know about the delimiter function at all, actually having only used the Concatenate block for the first time when I deployed your font resizing logic. Turns out it what I had was working, but your example helped clear up some of the 'why' questions I had.

    Cheers!
    #XPression