Graphics

 View Only
  • 1.  Scripting for Quad Position Change

    Posted 06-02-2016 20:13
    I have a Scene with a Quad to the left of a line of Text that is Center Aligned. I am trying to use scripting to change the Quad's X Position based on the width of the line of Text, but am having trouble getting it to work. I am running Xpression version 4.1, which doesn't support Visual Logic, so any help with the scripting would be appreciated. Thanks


  • 2.  RE: Scripting for Quad Position Change

    Posted 06-06-2016 14:04
    This script in OnOnline and OnPreviewRender should give you a starting point.
    It sets the X position of a quad to be the X position of the text object + the text width + half the quad width


    dim quad as xpBaseObject
    dim text as xpTextObject

    if Self.GetObjectByName("Quad1", quad) then
    if Self.GetObjectByName("Text1", text) then
    quad.PosX = text.PosX + text.BoundingBox.Width + (quad.BoundingBox.Width / 2)
    end if
    end if

    #XPression


  • 3.  RE: Scripting for Quad Position Change

    Posted 06-06-2016 20:29
    I was able to get that to work. Thanks for your help!
    #XPression