Graphics

 View Only
  • 1.  Image and Text Link

    Posted 03-27-2014 22:41
    Hi,

    Quick question, is there a way in Xpression to link a text field to an image name? For example if I have a 3 game NHL Scoreboard, when I select the team logos, the team names are automatically generated in a text field?


  • 2.  RE: Image and Text Link

    Posted 03-28-2014 14:31
    Hi Brandon,

    It's actually easier to do the opposite of this :)

    Rather than create text based on the image name, assign an image based on the text.

    You can download a sample here:

    Team Logo Scripts (Link Expires in 7 days)

    If you right click on the scene called 'Logos' and select 'edit script events' you'll see the script that performs the action. It's all commented to explain what it's doing.

    Basically, XPression will use the contents of a text object to assign an image with the same name to a quad.

    This script is very basic, and can be made more complex and efficient with some changes, but it works great and will get you started!

    #XPression


  • 3.  RE: Image and Text Link

    Posted 03-28-2014 20:48
    Thanks for the help!

    So to go "text to image" is easier but my original request is possible just a little more complicated? We do a lot of sports highlights. Local teams and national teams ranging from NHL, WHL, BCHL, CIS, CFL, NFL, MLB. Plus we sometimes have novice or "non sports fan' users so being able to have the option of just selecting the team logo and the name appearing would be nice

    #XPression


  • 4.  RE: Image and Text Link

    Posted 03-31-2014 15:41
    You might be able to backwards engineer that script, but like Garner said, it would be pretty crazy complicated.

    I may be wrong on this, but I remember Chris Kelly (sorry for calling you out on this one) telling me that

    object.GetMaterial

    will return boolean, so you can do:

    if object.GetMaterial(0, material) = True/False

    Is there a way to use that same function to determine which material you have? For example:

    if object.GetMaterial(0, blue) = True then

    teamname.Text = "Blue Team"

    elseif object.GetMaterial(0, red) = True then

    teamname.Text = "Red Team"

    else

    teamname.Text = "League Name"

    end if


    I'm spitting that out of nowhere and haven't tried it, just trying to get the idea started.

    You would need to be very specific about setting up your materials:

    dim blue as xpMaterial

    dim red as xpMaterial

    Engine.GetMaterialByName("Blue Team Logo", blue)

    Engine.GetMaterialByName("Red Team Logo", red)


    Just a start. Would take some brute force scripting, but could probably be done.

    #XPression