Can't figure out change-size animation for buttons
tamercloud
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.
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
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
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Tut, tut, this is obviously a AAA*sin(self.Time*BBB)+CCC situation !
Another quick demo attached:
I see you used my same file - "shink" instead of "shrink". Was in a hurry.
Well, double points for both of us.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
I don't know what you are talking about ?
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?
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.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Interpolate : self.size.width to self.size.width * 1.1
Interpolate : self.size.height to self.size.height * 1.1