Graphics

 View Only
  • 1.  Need a little help with a simple script. (helping out a fellow designer)

    Posted 24 days ago

    Imagine a game where a number of blank squares appear on the screen under a question, ala wheel of fortune. Contestant starts guessing letter rapid fire up to a max 0f 10 guesses. I have a dashboard that holds 27 buttons per row (A-Z and blank default). As the operator clicks on a given letter it sets Data1 value. Meanwhile the answer text is fed by an excel sheet. So, on OnSetText for the DATA1 field I have the following script.

    dim letter1 as xpTextObject
    dim letter1Vis as xpBaseObject
    dim Data1 as xpTextObject

    engine.getobjectbyname("LETTER 1",letter1)
    engine.getobjectbyname("LETTER 1",letter1Vis)
    engine.getobjectbyname("DATA_1", Data1)


    if Data1.text = letter1.Text then
    letter1Vis.Visible = true

    else
    letter1Vis.Visible = false

    end if

    A simple visibility switch based on whether two data field match. I think I am missing something simple and small. Helping out a fellow designer.

    Thanks in advance



    ------------------------------
    Malcolm Thorpe
    xpression design
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------



    ------------------------------
    Malcolm Thorpe
    xpression design
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------


  • 2.  RE: Need a little help with a simple script. (helping out a fellow designer)

    Posted 21 days ago

    getObjectByName belongs to xpScene, so depending where this script is, use:

    Scene.getObjectByName or Self.getObjectByName

    Also, letter1Vis is redundant. Just use letter1. It has all the props and methods of xpBaseObject plus extra for text.

    Use the Xpression API documentation.



    ------------------------------
    Azathoth
    Son of Cthulhu
    ------------------------------