Graphics

 View Only
  • 1.  Visual logic and conditional

    Posted 01-09-2015 17:52
    Hello !

    I need to make a conditional script with visual logic. I got 2 counters and 2 graphics elements.

    I want that visibility of the graphic depends of the incrementation of the counter.

    When counter1 is increment graphic1 is visible and graphic2 is not visible

    When counter2 is increment graphic2 is visible and graphic1 is not visible

    I figure that I have to use the value of my text (the counter) but I didn't find how to make the conditional.



    Thanks


  • 2.  RE: Visual logic and conditional

    Posted 01-12-2015 10:10
    Maybe it's more easy to set in the keyboard map a shortcut who set the value of the text field at +1 and the visibility of the graphic.

    Is there a way to assign visual logic in the keyboard map ?

    #XPression


  • 3.  RE: Visual logic and conditional

    Posted 01-16-2015 08:49
    I actually working with Prime 5.7 which is probably not the good version to do what I need and I will probably need a studio version....

    Anyway I have searched with Prime how to do what I need and wanna share.

    I need to put online a scene compose of one major graphic that I have to associate 4 other graphics depending of the situation.

    With keyboardmap scripting you can take online the scene on a shortcut that put the material number (1, 2, 3 or 4) visible.

    Here I use the "SetPlayRange" fonction on the keyboard map. The scene was created with 4 parts.

    First part from image 1 to image 5 : material 1 is visible,

    Second part form image 6 to image 10 : material 2 is visible… etc

    Then 4 shortcuts are implement in keyboardmap with a "set play range" that play the scene from image 1 or 10 or 15 or 20 depending of which material I need to put online but using only one scene.

    For the 2 counters and material visibility I don't have access to widgets parameters or shortcuts with visualLogic.

    I was thinking to have 2 texts field for each counter. The first one is just a text field set at 0 "score1" and the second one is the counter "counter1".

    Then compare the 2 value of those texts and if "counter1" is greater than "text1" set the visibility of the graphic and replace the value of "text1" by "counter1"

    I have tried several scripts but it doesn't work ïŠ



    I also tried with one more text field : "store1" in which I store a value 0 when the counter1 increase and value 1 when counter2 increase in order to set the visibility of my 2 materials



    It's doesn't work neither ïŠ

    #XPression


  • 4.  RE: Visual logic and conditional

    Posted 01-16-2015 21:08
    Wasn't quite sure what you wanted the scene to do, but I'm pretty sure this code should do what you were trying with visual logic.

    dim score1, counter1 as xpTextObject

    dim rouge, bleu as xpBaseObject

    dim Score1Value, Counter1Value as integer

    Self.GetObjectByName("score1", score1)

    Self.GetObjectByName("counter1", counter1)

    Self.GetObjectByName("rouge", rouge)

    Self.GetObjectByName("bleu", bleu)

    Score1Value = Cint(score1.text)

    Counter1Value = Cint(counter1.text)

    if Counter1Value > Score1Value

    rouge.visible = true

    bleu.visible = false

    score1.text = counter1.text

    else

    rouge.visible = false

    bleu.visible = true

    end if

    #XPression