Announcement

Collapse
No announcement yet.

Hide object/Show Object - Same button?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hide object/Show Object - Same button?

    Is it possible to have one button on click event to show and another click (same button) to hide?...show/hide...show/hide.



    Text1



    Text1


  • #2
    Re: Hide object/Show Object - Same button?

    What you want is a toggle. Set a variable to true or false each time the button is clicked. (If it's true, set it to false, otherwise set it to true.)

    Like so:

    IF (%foo%)
    // turn it off
    %foo% = 0
    ELSE
    // turn it on
    %foo% = 1
    END IF

    Then, add in the stuff to do the showing and hiding, depending on whether it's being toggled on or off.
    --[[ Indigo Rose Software Developer ]]

    Comment

    Working...
    X