creating a mute button
EpicoreGames
Member Posts: 188
i have been searching in the forum to find my answer but they seem to be old questions and also old systems.
i set my mute button to change the image to my unmute button( changes the image ) and stop the music when player presses on it and it works.
but i want it to play the song again when the player hits the button again.
how can i do that?
Comments
Make a game.integer lets call it Music (leave it set to 0), now in your actor for the music on/off button make a rule if touch is pressed change game.Music to ( game.Music+1)%2
What the above will do is every time the user presses the actor it will change the game.Music from 0-1-0-1-0-1 so now you take the game.Music and make a rule if =1 change image, stop sound/music etc in the otherwise do change image, play music etc.
There is no way to pause the music, you can stop it and then restart it from the beginning - or you can mute it and unmute it.
erm.... ya .... did i say pause the music?...
@DeepBlueApps that works ! but i noticed that if i press it for more than 2/3 seconds it will stuck at the mute button image and when i press on it and drag my mouse out of the button without depressing it will also stuck .
is it a bug or there's something wrong in my code ?
http://postimg.org/image/dhtp7jt07/
http://postimg.org/image/e7daca28f/
You mentioned wanting to stop the music and then starting it playing again, generally speaking this would be done with a pause button.
ok..ok..