How to make a button darken when touched!

Hey guys
Can anybody explain to me how do you make a button darken when it's touched
Can you guys also include the rules or little guidelines that I need to do

Thanks
Cheers!!

Comments

  • ashtmjashtmj Member, PRO Posts: 405
    When touch is pressed

    Change attribute self.color green to 0.5

    Change attribute self.color red to 0.5

    Change attribute self.color blue to 0.5

    then in the other wise, add these three rules

    Change attribute self.color green to 1

    Change attribute self.color red to 1

    Change attribute self.color blue to 1
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited January 2014
    @ashtmj ... I never thought to do it that way. You're basically creating a grey version of the image.

    Another way is to change self.color.Alpha to 0.5 or some other value between 0 (fully transparent) and 1 (full opaque). So for example, when touch is pressed change attribute self.color.alpha to 1; Otherwise change attribute self.color.alpha to 0.5.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.