How do I ON/OFF Sound Button

Get help using Construct 2

Post » Sat Oct 24, 2015 10:15 pm

I want to make ON/OFF Sound button.For Example,in some other game menu there is this button.How can I do?Thanks for sharing.
My first Game:
https://play.google.com/store/apps/deta ... bellc2.WOB

WORDPRESS:https://wobgame.wordpress.com/
B
22
S
5
Posts: 20
Reputation: 1,297

Post » Mon Oct 26, 2015 11:23 am

I'm still waiting for your answer.+++++++++++
My first Game:
https://play.google.com/store/apps/deta ... bellc2.WOB

WORDPRESS:https://wobgame.wordpress.com/
B
22
S
5
Posts: 20
Reputation: 1,297

Post » Mon Oct 26, 2015 12:12 pm

Try:
Button On clicked-->Set silent

or

Button On clicked-->Set master volume to (enter a value about -40 db or so)
B
13
S
5
G
1
Posts: 116
Reputation: 1,805

Post » Mon Oct 26, 2015 2:09 pm

Is there any retouch or reclick function in c2?I want to learn this.
My first Game:
https://play.google.com/store/apps/deta ... bellc2.WOB

WORDPRESS:https://wobgame.wordpress.com/
B
22
S
5
Posts: 20
Reputation: 1,297

Post » Mon Oct 26, 2015 2:34 pm

Maybe you mean a toggle button? Like press it once ->ON, press it a second time ->OFF?

Create an instance variable on the button (select type:Boolean and let's call it "state")
On the "On clicked" event of the button add an action: Button toggle state
This value will switch from 0 to 1 every time you press the button.

Image
B
13
S
5
G
1
Posts: 116
Reputation: 1,805

Post » Mon Oct 26, 2015 4:38 pm

Yeah! Its working thanks a lot.
My first Game:
https://play.google.com/store/apps/deta ... bellc2.WOB

WORDPRESS:https://wobgame.wordpress.com/
B
22
S
5
Posts: 20
Reputation: 1,297


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 25 guests