Can't figure out change-size animation for buttons

tamercloudtamercloud Member Posts: 13
Hi guys,

I'm relatively new at using game salad. What I am trying to do is when the user mouse-overs an image-based button in a menu, I want it to animate by doing a loop of increasing, then decreasing in size, and when the user leaves the button, I want it to shrink back to normal size. I've tried many things involving the change size attribute and timers, but nothing seems to be working.

Any help would be greatly appreciated.

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Rule:

    When attribute mouse position is inside:
    Interpolate : Self. Size. Width to X ( X = Anything larger than current width)
    Interpolate : Self. Size. Height to X ( X = Anything larger than current height)
    OTHERWISE:
    Interpolate : Self. Size. Width to Initial Width
    Interpolate : Self. Size. Height to Initial Height

    I've also included a quick demo.
    Hope this helps,
    Braydon
  • SocksSocks London, UK.Member Posts: 12,822
    @Braydon_SFX

    Tut, tut, this is obviously a AAA*sin(self.Time*BBB)+CCC situation ! :)

    Another quick demo attached:
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Lol, Was trying to do something simple for this gentleman. :P
    I see you used my same file - "shink" instead of "shrink". ;) Was in a hurry.
    Well, double points for both of us. ;)
  • SocksSocks London, UK.Member Posts: 12,822
    I see you used my same file . . .

    I don't know what you are talking about ? ;)
  • tamercloudtamercloud Member Posts: 13
    Thanks guys, this is exactly what I was looking for!
  • tamercloudtamercloud Member Posts: 13
    After putting all my buttons in place, it seems like a hassle to find the exact height and width for my buttons so that they scale up in the right proportion.

    Is there a way to do this with percentages or something so that if I decide to change the button size later on, I will not have to start all over with scaling button size?
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    edited June 2013
    Sure

    Create two integer or real attribute and set it to how much you'd like to increase the button size

    So:
    game.IncreaseWidth
    game.IncreaseHeight

    Then in your buttons

    Interpolate self.Width to self.Width+game.IncreaseWidth
    Interpolate self.Width to self.Width+game.IncreaseHeight

    Otherwise:

    Interpolate self.Width to self.Width-game.IncreaseWidth
    Interpolate self.Width to self.Width-game.IncreaseHeight

    EDIT: Socks, don't get mad at me. ;)
  • kolabokolabo Member Posts: 240
    After putting all my buttons in place, it seems like a hassle to find the exact height and width for my buttons so that they scale up in the right proportion.

    Is there a way to do this with percentages or something so that if I decide to change the button size later on, I will not have to start all over with scaling button size?
    To do this, I use multiplication in my rule. Similar to Braydon_SFX's first suggestion, but with multiply.
    Interpolate : self.size.width to self.size.width * 1.1
    Interpolate : self.size.height to self.size.height * 1.1
  • tamercloudtamercloud Member Posts: 13
    After putting all my buttons in place, it seems like a hassle to find the exact height and width for my buttons so that they scale up in the right proportion.

    Is there a way to do this with percentages or something so that if I decide to change the button size later on, I will not have to start all over with scaling button size?
    To do this, I use multiplication in my rule. Similar to Braydon_SFX's first suggestion, but with multiply.
    Interpolate : self.size.width to self.size.width * 1.1
    Interpolate : self.size.height to self.size.height * 1.1
    I've tried doing something like this but it didn't work. When I hovered my mouse over the button it got really small, then normal, and it kept bouncing back and fourth. I don't know if it's because I'm using a PC, but it doesn't seem to recognize "self.size.width" in the "to:" area.

  • tamercloudtamercloud Member Posts: 13
    Sure

    Create two integer or real attribute and set it to how much you'd like to increase the button size

    So:
    game.IncreaseWidth
    game.IncreaseHeight

    Then in your buttons

    Interpolate self.Width to self.Width+game.IncreaseWidth
    Interpolate self.Width to self.Width+game.IncreaseHeight

    Otherwise:

    Interpolate self.Width to self.Width-game.IncreaseWidth
    Interpolate self.Width to self.Width-game.IncreaseHeight

    EDIT: Socks, don't get mad at me. ;)
    Do you have an example using this method? I've tried exactly what you said but it isn't recognizing the area in the "to:" field as a valid value, and is coming up as 0.

Sign In or Register to comment.