Best way for "depressed button" effect?
I've been struggling with this in all my games. I'm trying to find the best method for when a change scene button is pressed or clicked the button is depressed and a sound is played when the button changes a scene. The problem is that as soon as the button is pressed, the scene is changed before any effects have a chance to occur. I'm curious what everyone has done to accomplish this effect? I usualy have to use timers, but that doesn't seem very elegant to me.
Best Answers
-
jigglybean Posts: 1,584
You could tell it a bad joke
Or add a timer. If you are trying to make a depressed button animation, its best to use 2 different images with a rule when touch is down change image to Button_depressed. Then when touch is released change image back to your original
Like Balls? Then click here! We've 100 coming soon
-
iamcartez Houston, TexasPosts: 648
This is what I do nowadays...
2 rules:
Rule 1
Touch is pressed:Change image to button pressed image
Add sound effect or anything here.
.....Otherwise... change image back to original image.
Rule 2
Touch is released:Do stuff...
(Add timer and add the Change Scene rule here.)***This way users can press and hold as long as they want however if the user decides to press and drag their finger outside of the actor, it will not trigger Rule 2. I used this method in my new game as well...
Answers
Thanks for the input, that's what I've been doing, I just wish there was a way to do it without a timer. I could put the change scene rule for when touch is released instead of pressed, but I think there are some bugs with 'touch is released' in Gamesalad as I've had Android apps crash using that rule. Or I could try the joke