Graphics

 View Only
  • 1.  Dashboard Help

    Posted 03-13-2018 15:18
    Hey there,

    so I am currently making a sports board of sorts for fun, and I have become stuck. I am integrating the scene with a dashboard and currently to display yellow cards, I have a button that triggers a gpi which plays a scene director where the card alphas on. Simple.

    When it comes to resetting the player however, I have another gpi that triggers the same scene in reverse. The first time I do this it works perfectly but if I then do it again, it gets stuck and doesn't reset unless I open the scene director as well.

    I was wondering if there is a simpler way of doing this, maybe linking a check box that determines if the card is visible or not. Does anyone had any experience in something like this?

    Cheers


  • 2.  RE: Dashboard Help

    Posted 03-13-2018 17:19

    This director will play the animation when you click the dashboard. It will then play it in reverse when you click the button again.

    dim scene as xpScene
    dim fb as xpOutputFramebuffer
    dim scenedir as xpSceneDirector
    dim layer as integer

    engine.GetOutputFramebuffer(0, fb)
    for layer = 0 to 10
    if fb.GetSceneOnLayer(layer, scene)
    then if Scene.Name = "YOUR SCENE"
    then if scene.GetSceneDirectorByName("YOUR DIRECTOR", scenedir)
    then if scenedir.position >= 150 then scenedir.PlayRange(150, 0) else
    scenedir.PlayRange(0, 150)
    end if
    end if
    end if
    end if
    next




    If you put this on the GPI trigger script where your scene director and Scene are customized it will check to see where the play head is on your scene director and simply play it it reverse. Change the upper number in the PlayRange field to set the limit. I hope this helps This will play on any layer from 0 to 10. If you know you are going to be on layer 0 you can omit the for loop and its associated next loop.


    #XPression


  • 3.  RE: Dashboard Help

    Posted 03-14-2018 12:33
    Thanks for this, I tried this code and am getting syntax errors on line 9, 10 and 11

    Lines 14,15, 16 are also saying " 'End If' must be preceded by a matching 'If' "
    #XPression


  • 4.  RE: Dashboard Help

    Posted 03-14-2018 13:38
    My bad. Edit the script so that each "then" is at the end of the line of text above it. Those line should start with "if". Sorry about that.
    #XPression


  • 5.  RE: Dashboard Help

    Posted 03-14-2018 13:41
    dim scene as xpScene
    dim fb as xpOutputFramebuffer
    dim scenedir as xpSceneDirector
    dim layer as integer

    engine.GetOutputFramebuffer(0, fb)
    for layer = 0 to 10
    if fb.GetSceneOnLayer(layer, scene) then
    if Scene.Name = "YOUR SCENE" then
    if scene.GetSceneDirectorByName("YOUR SCENE DIRECTOR", scenedir) then
    if scenedir.position >= 150 then
    scenedir.PlayRange(150, 0)
    else
    scenedir.PlayRange(0, 150)
    end if
    end if
    end if
    end if
    next

    #XPression