GameSalad app buttons pressed..

DevilsDevils Member Posts: 561
edited November -1 in Working with GS (Mac)
Hello guys I was wondering how can we get the button on our apps to look like they are being pressed (i.e the play button in Mega Jump) to add a more realistic feel to it.

Comments

  • StusAppsStusApps Member, PRO Posts: 1,352
    of course. you just need to either change image or change size when pressed.

    For example if it is a change scene button:

    When actor receives event touch is pressed

    Change attribute self.width = 55
    Change attribute self.height = 15
    Play sound somesound.ogg
    Timer after 0.5 secs - Change scene to .......

    In the otherwise bit:

    Change attribute self.width = 60
    Change attribute self.height = 20

    Obviously this depends in the look you want. If you really want it to look like a pushed button then draw a pushed button and a non-pushed button and change the image between the two when pressed.
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    There's no need for timer here. For more natural action, do the following...

    Just create an integer attribute (self.pressed, initialized to 0) that gets cycled to 1 on touch is pressed. That would also trigger any "pressed" animation or image change. Then, create a rule for your action, check for touch is released AND self.pressed = 1. At the end of the actions in that rule, reset self.pressed to 0.

    This will hold the action until the touch is lifted from a given button.
Sign In or Register to comment.