creating a mute button

EpicoreGamesEpicoreGames Member Posts: 188
edited February 2015 in Working with GS (Mac)

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

  • UtopianGamesUtopianGames Member Posts: 5,692

    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.

  • SocksSocks London, UK.Member Posts: 12,822

    @gamesalad7023661 said:
    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?

    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.

  • EpicoreGamesEpicoreGames Member Posts: 188

    erm.... ya .... did i say pause the music?...

  • EpicoreGamesEpicoreGames Member Posts: 188

    @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 ?

  • SocksSocks London, UK.Member Posts: 12,822

    @gamesalad7023661 said:
    erm.... ya .... did i say pause the music?...

    You mentioned wanting to stop the music and then starting it playing again, generally speaking this would be done with a pause button.

  • EpicoreGamesEpicoreGames Member Posts: 188

    ok..ok..

Sign In or Register to comment.