Graphics

 View Only
  • 1.  Multiple line full screen graphics question...

    Posted 01-22-2014 00:09
    We've got a full screen template that have the ability to pick how many lines of text are desired (1-5) and the position of each line is adjusted vertically to space evenly from top to bottom. However, we've got some cases where people are just picking 5 lines and entering 3 lines, and the spacing is off, with a lot of space at the bottom. Is there a script that can determine how many lines have text actually entered in them, and force the correct spacing based on that?


  • 2.  RE: Multiple line full screen graphics question...

    Posted 01-29-2014 14:51
    It's roundabout, but I think I could try a hack at this one.

    First, you'd need to establish all of your text objects

    dim text1, text2, text3, text4, text5 as xpTextObject

    then attach them to the object in your object manager

    Self.GetObjectByName("Text 1", text1) ...etc...

    Then comes the big one. I just did this recently with a sports scene, and can tell you it takes a bit of planning. Start big and work down.

    if Len(text1.Text) > 0 and Len(text2.Text) > 0 and Len(text3.Text) > 0 and Len(text4.Text) > 0 and Len(text5.Text) > 0 then

    text1.PosY =

    text1.PosX =

    text1.Scale =


    ...etc etc for each object that you need to move. The Len(text1.Text) will spit out a character length of the line. So this is saying if the number of characters is greater than 0 (which it would be if there's text in it), then do this other stuff.

    Then comes the next part, get one for four:

    elseif Len(text1.Text) > 0 and Len(text2.Text) > 0 and Len(text3.Text) > 0 and Len(text4.Text) > 0 and Len(text5.Text) = 0 then

    ...and on and on. Notice that text5 has "= 0" in this case instead of "> 0." Basically, using this idea, you could build out a whole list of possible combinations and where to move them as needed. For five lines, that would be 31 different combinations (11111, 11110, 11101, 11100, 11011, etc...). That'd be a big block of code, but it would work.

    Perhaps someone with some more knowledge could help out with how to shorten that down?

    #XPression


  • 3.  RE: Multiple line full screen graphics question...

    Posted 01-29-2014 14:58
    The way we've avoided doing something like this here is by putting bullet points in front of each line. That way, if they put in a blank line, there's an extra bullet point floating around that doesn't need to be there. However, we've caught that by writing a script that will just eliminate the visibility of the bullet point if there's no text in it.

    [CODE]dim line as xpTextObject 'I used "line" instead of "text" because "text" is used so often elsewhere

    dim bullet as xpBaseObject

    dim i as Integer

    for i = 1 to 5 'or whatever arbitrary number you need

    Self.GetObjectByName("Text " & i, line)

    Self.GetObjectByName("Bullet " & i, bullet) 'these lines have a space following the name in the quotes.

    'The object names should be "Text 1" and "Bullet 1" or something of that sort.

    'It's much easier to write bulk script when you can loop through like this

    If Len(line.Text) > 0 then

    Bullet.Visible = True

    elseif Len(line.Text) = 0 then

    Bullet.Visible = False

    end if

    next i

    We use a variation of this script EVERYWHERE in our package. Most useful thing on earth. Since visibility isn't controlled by animation controllers (they use alpha), I can create an animation controller for this, and it can still run, but be running with no visibility for scenes that are extraneous.

    Hope these posts help. Good luck if you go with the big block earlier.

    #XPression