Graphics

 View Only
  • 1.  Copy line from text object to another text object

    Posted 18 days ago
    Hello!

    In my scene i have one text object, named "team". I want to identify each line from this text object and copy (each line) in separate text objects. To exemplify this, if in my "team" text object i enter this: 
    Player1
    Player2
    Player3
    what i want to achieve is to copy line 1 from "team" in another text object named "line1", therefore in my "line1" to have now as input text "Player1". Same for other lines, "line2" to have "Player2" etc...
    I don't see how to make this possible via visual logic, and i don't have any clue how to script this. Any help is welcome!
    We run on Xpression 5.9 SCE.

    ------------------------------
    Gheorghe Radu
    Graphics Team
    Clever Media Network
    ------------------------------


  • 2.  RE: Copy line from text object to another text object

    Ross Staff
    Posted 10 days ago
    You want to write something that at its most simple would be,

    dim ln1, ply1 as xptextobject 

    scene.getobjectbyname("Line1", ln1)
    scene.getobjectbyname("Player1", ply1)

    ply1.text = ln1.text 


    however this quite slow so a loop would work well onOnline;

    dim line, player as xpTextObject

    dim i as integer 

    for i = 1 to 11
    self.getobjectbyname("Line" & i, line)
    self.getobjectbyname("Player" & i, player)

    player.text = line.text 
    next 


    it's best to put the same script in OnPreviewRender as well so you see it preview.

    ------------------------------
    Simon Redmile
    Senior Graphic Programmer & Designer
    Ross Video
    Bristol United Kingdom
    ------------------------------