Graphics

 View Only
  • 1.  Scripting Group Object visibility

    Posted 01-24-2014 19:06
    Hi there,

    I've been looking through the SDK, but I cannot find a way to hide a group object through scripting.

    Basically, I'll be changing a widget between two values, which I would like to toggle the visibility of the group, (which contains about 17 objects.)

    So, essentially,

    "if widget says ' left' then

    leftgroup alpha = 100 else

    leftgroup alpha = 0

    end if"

    But I don't know how to call that group in the first place.

    Thanks!


  • 2.  RE: Scripting Group Object visibility

    Posted 01-24-2014 19:34
    Hi,

    you're basically looking for something like this:

    dim obj as xpBaseObject

    Self.getObjectByName("leftgroup",obj)

    if widget = "left" then

    obj.alpha = 100

    else

    obj.alpha = 0

    end if

    Another option would be to use obj.visible = true or false. This will toggle the visibility on or off.

    Good luck,

    Kenneth

    #XPression


  • 3.  RE: Scripting Group Object visibility

    Posted 01-24-2014 19:53
    Thanks Kenneth!

    #XPression


  • 4.  RE: Scripting Group Object visibility

    Posted 01-24-2014 20:32
    Hi Chris,

    Just to further explain why I was setting alpha=100 or =0 in the script in your project instead of using the .Visible property that Kenneth mentions; is because the Alpha can also be keyframed. So you can have an animation controller that restores the alpha to 100% when you run the animation.

    If you use the .Visibile property (this is the same as turning the "EYE" on or off in the UI), then there is no way to restore it back to visible unless you use another script to do it.

    #XPression