Graphics

 View Only
  • 1.  Datalinqing Position

    Posted 06-03-2014 22:13
    IS there a way to dtalinw the position of a text field? I am trying to build a starting line up graphic for soccer where there are hundreds of different possible formations. The idea is that instead of making every possible location and driving there visibility on the fly via datalinq, I want to make 11 textboxes and modify their position via datalinq depending on the formation the starting line up is using. Thanks.


  • 2.  RE: Datalinqing Position

    Posted 06-03-2014 23:45
    You would need to datalinq to a hidden text object and use an OnSetText script on that text object to adjust the position of one of your 11 other text objects.

    #XPression


  • 3.  RE: Datalinqing Position

    Posted 06-03-2014 23:54
    So I would need 2 hidden text per object then? One for X and one for Y?

    #XPression


  • 4.  RE: Datalinqing Position

    Posted 06-03-2014 23:57
    That depends on how the data in your datalinq source is.. If your datasource sends the data like "400,650" then you would only need one hidden text object and your script could split that into both X,Y by splitting based on the comma..

    If your datasource sends X and Y separately then you would need two hidden text objects..

    #XPression


  • 5.  RE: Datalinqing Position

    Posted 06-04-2014 14:32
    What does your data feed look like? If it includes the position they're playing, you could skip the extra objects and just pull it from the position. nI'm going to display my lack of knowledge of soccor, by only using two positions in my example, but here goes.

    So if someone is playing forward, is there an "F" or "forward" or anything unique to that position that you can use? Same for say goalie. If there is, you can use a script to find their position they play, then place them based on that.

    Start by placing all of the players' objects in their own groups. Photos, names, any graphics that need to move with them, etc. Call them "Player 1," "Player 2," etc... Make sure that in that group, you put a number after each of them "name 1," "position 1," "graphic 1," etc. This makes scripting way easier, as you can use a loop to build it out.

    dim player as xpBaseObject

    dim position as xpTextObject

    dim i as Integer

    'this part will cycle through all of the player groups and place them individually

    for i = 1 to x (how many players you'll be doing)

    Self.GetObjectByName("Payer " & i, player)

    Self.GetObjectByName("Position " & i, position)

    if InStr(Ucase(position.Text), "F") = 1 then 'if your data uses something else for that position, just change out the F

    player.PosX='whatever your X value is for forward

    player.PosY='whatever your Y value is for forward

    elseif InStr(Ucase(position.Text), "G") = 1 then

    player.PosX='X value for goalie

    player.PosY='Y value for goalie


    and on and on for each position until

    end if

    next i


    #XPression


  • 6.  RE: Datalinqing Position

    Posted 06-04-2014 14:36
    So in a quick search, I found these positions:

    GK, RFB, CFB, LFB, RDMF, LDMF, ROMF, LOMF, RF, CF, LF

    Each of those could be used if it's in your data stream in order to place your objects. The InStr( function looks for the second string within the first string, then spits out a number where it exists. That's why the =1 is in there. You could just write a single if/elseif for the whole team.

    #XPression


  • 7.  RE: Datalinqing Position

    Posted 06-04-2014 18:01
    My concern is that different formations exist. You could go from a 4-4-2 to a 4-5-1 or just a whole litany of other formations. A Left Forward or a Right Forward would line up differently based on rather or not there a cent Forward.The same with the defense. You could also have a pair of defensive mids line up in the back with your whole defense forming a line. I was thinking it would be easier o decide exactly what the player formation looks like then move the location on the graphic based on the is My data source i going to be a dashboard xml so it can be what ever it needs to be to make the xpression easier.

    #XPression