Sounds toggle on and off

Get help using Construct 2

Post » Sun Apr 14, 2013 1:22 pm

Hi,
I have problem with sounds, I have sounds on and off button on one layer and it works when I toggle the sounds on and off, but when I go to play screen the sounds come back on because play layout always resets all global variables.

How can I reset all the variables except the sound?

Or is there some other way to get it working?

Thanks
B
7
S
1
G
3
Posts: 27
Reputation: 2,169

Post » Sun Apr 14, 2013 1:38 pm

There may be a better way, but basically I've done one of two things...
1. use an array with one value
2. before you reset globals, set a local variable called 'PreserveMute' to the value of Mute. after the reset, set 'Mute' to 'PreserveMute'.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Apr 14, 2013 2:42 pm

Thank you,
I'll go and test your method and post results later
B
7
S
1
G
3
Posts: 27
Reputation: 2,169

Post » Sun Apr 21, 2013 9:32 pm

Worked great,
only thing it didn't mute was looping sound for some reason, but I managed to workaround on that issue.
Thanks!
B
7
S
1
G
3
Posts: 27
Reputation: 2,169


Return to How do I....?

Who is online

Users browsing this forum: h1k3, Unconnected and 0 guests