Graphics

 View Only
  • 1.  Scripting Text Y position move

    Posted 09-02-2013 04:38
    Hi all,

    I have the following script on my Lower 3rd text to bring on a quad when text is typed into the text box

    dim bar as xpBaseObject

    scene.GetObjectByName("BASELINE_D", Bar)

    if Len(text) > 0 then

    Bar.visible = True

    else

    Bar.visible = False

    end if

    Now I want to change the Y position value relative to text input in another text layer.

    If the text layer has content, I want the text box to move up to make room. If there is no text, I want it to stay where it is.

    How do I incorporate this into the current script? I am not sure on syntax, and I am having issues getting my head around how to interpret the Help documentation.

    Any help or advice would be appreciated!


  • 2.  RE: Scripting Text Y position move

    Posted 09-02-2013 05:14
    if you wanted to move a second text line based on this one being null or having text, a rough script would be:

    dim text2 as xpBaseObject

    scene.GetObjectByName("Line2", text2) < this is the text line you want to move

    if trim(text) "" then

    text2.posX = 10.0

    else

    text2.posX = 20.0

    end if

    you can use posY as well. Another one I've been using lately is SetPosXYZ - which can set all 3.

    The syntax is a little different though.. it would be --> text2.SetPosXYZ (10.0, 0.0, 0.0)

    #XPression


  • 3.  RE: Scripting Text Y position move

    Posted 09-02-2013 23:24
    Thanks for that! I was a bit stuck without that code.

    I had a play with what you gave me and came up with this tweak.

    dim text1 as xpBaseObject

    scene.GetObjectByName("Top Line Text", text1)

    if Len(text) > 0 then

    text1.posY = -405.00

    else

    text1.posY = -430.0

    end if

    Going to have a play with the SetPosXYZ next.

    Thanks again!

    #XPression