Graphics

 View Only
  • 1.  Xpression Autofollow Text

    Posted 06-01-2023 17:25
      |   view attached

    Hello! I have been trying my best to figure out how to get a quad to auto follow the length/width of a text with a wordwrap through visual logic. The problem I've been running into is that I can't have the quad follow the text again once it word wraps it to the second line. I've attached an animation reference to what I'm talking about. Let me know if it's even possible to do it. Thanks in advance!



    ------------------------------
    Tani Belliston
    ------------------------------


  • 2.  RE: Xpression Autofollow Text

    Posted 06-05-2023 04:56

    Hi Tani.
    In this case you will need to create some text objects. One of them is for input text and you will need to hide it from online render (put it into a layer object with enabled property 'Render Layer in Preview Only').
    Others of them are for output text with auto follows quads (the maximum amount you can be expected, for example 4) and desable on them 'Publish Object' in the 'Template Links' tab. For eache output text object create a quad with autofollow.
    Then put the scrip below into the input text object 'OnSetText' tab in an  'Edit Script Events' 

            Dim intext() As String = Text.Split(Chr(10))
            Dim outtext(3)
            For i As Integer = 0 To 3
                scene.GetObjectByName("OutText_" + CStr(i), outtext(i)) 'output text objects named as 'OutText_0, OutText_1, OutText_2 and etc'
                outtext(i).Text = ""
            Next
            For i As Integer = 0 To intext.Length - 1
                outtext(i).Text = intext(i)
            Next


    ------------------------------
    Roman Yaroshenko
    chief specialist
    RBC-TV
    Moscow Russian Federation
    ------------------------------