Disable button

patapplepatapple Member Posts: 873
edited February 2012 in Working with GS (Mac)
Hi,

How can i disable an actor (it's a button) ??? And after an action Rehabilitate the actor???

Thanks everyone

Comments

  • GLGAMESGLGAMES SingaporeMember Posts: 988
    edited February 2012
    Ah i see you are asking for something else..
    Below is the answer
  • MotherHooseMotherHoose Member Posts: 2,456
    edited February 2012
    change the button's Position X or Y to an off-screen position … EX: when you want disabled … changeAttribute: self.Position.Y To: -300

    and when you want to rehabilitate: changeAttribute: self.Position.Y To: on-scenePosition.Y

    faster/smoother than destroy/spawn

    @};- MH

    EDIT: if you want the button to stay on-screen, but inactive, changeAttribute: self.Color.Alpha To: 0.5
    then when rehabilitating changeAttribute: self.Color.Alpha To: 1

    and on your touched is pressed Rule: add condition to check the alpha state
    Rule: when (All)
    Event: touch is pressed
    Attribute: self.Color.Alpha = 1
    --do this
  • patapplepatapple Member Posts: 873
    Thanks!!! It works fine
Sign In or Register to comment.