[Solved] How do I make a Slider Bar to control sound?

Get help using Construct 2

Post » Mon Jun 15, 2015 7:02 am

How do i make a Slider Bar to activate/deactivate sound, or more advanced: sensibily control sound percentage? Thanks in advance!
Last edited by DaniellMesquito on Tue Jun 23, 2015 8:49 am, edited 1 time in total.
Liked something I say?
Tip. My Bitcoin address: 1PLaeKmXQ8vEdGGJqXMq3KyB8hxeddxeSv
B
25
S
7
G
4
Posts: 326
Reputation: 3,903

Post » Mon Jun 15, 2015 9:12 am

The slide bar will have it minimum and maximum values set by you, and the sound volume has 0 as original sound, positive volume amounts will increase the volume and negative will decrease.

Just create and event to every tick, or every time the user change the bar values the value of the sound volume to be set as the value of the bar.

In addition to that, you can create a condition that if the value of the bar is equal to it's minimum then the sound should be muted
B
17
S
7
Posts: 280
Reputation: 2,522

Post » Thu Jun 18, 2015 4:36 am

This is very complicated. Now, i will only made an simple Slider Bar with an range of 2 values. @deathangel1479 , have you any idea? =/
Liked something I say?
Tip. My Bitcoin address: 1PLaeKmXQ8vEdGGJqXMq3KyB8hxeddxeSv
B
25
S
7
G
4
Posts: 326
Reputation: 3,903

Post » Thu Jun 18, 2015 4:44 am

Which is the value that define that the sound is muted?
Liked something I say?
Tip. My Bitcoin address: 1PLaeKmXQ8vEdGGJqXMq3KyB8hxeddxeSv
B
25
S
7
G
4
Posts: 326
Reputation: 3,903

Post » Thu Jun 18, 2015 5:22 am

There is no value for that. You can either set a extremely low value like -100 or set the sound to mute through event
B
17
S
7
Posts: 280
Reputation: 2,522

Post » Thu Jun 18, 2015 5:44 am

Edit: Link removed, newer one a few posts further.

I beginn on 40, because all under is to silence, so you dont have halfe slider with unhearable.
But adjust how you want. You also can add more than one Audio Object.
Last edited by deathangel1479 on Fri Jun 19, 2015 9:55 am, edited 4 times in total.
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
11
S
4
G
1
Posts: 158
Reputation: 1,328

Post » Thu Jun 18, 2015 6:03 am

@deathangel1479 and @RayKi thanks guys, this solved my problem! :D
Thanks again deathangel1479, your .capx is very usefull, fast to use and problem killer. Thank you very much! :D
Liked something I say?
Tip. My Bitcoin address: 1PLaeKmXQ8vEdGGJqXMq3KyB8hxeddxeSv
B
25
S
7
G
4
Posts: 326
Reputation: 3,903

Post » Fri Jun 19, 2015 5:19 am

@deathangel1479 , I've modified the .capx, and added some features. Why the Local Storage isn't working? :?
Liked something I say?
Tip. My Bitcoin address: 1PLaeKmXQ8vEdGGJqXMq3KyB8hxeddxeSv
B
25
S
7
G
4
Posts: 326
Reputation: 3,903

Post » Fri Jun 19, 2015 7:46 am

Thats easy, because every tick is faster than the hole local storage get.
You set the local Storage, before you got it.

Set it later, for example: on slider value change.
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
11
S
4
G
1
Posts: 158
Reputation: 1,328

Post » Fri Jun 19, 2015 8:06 am

@deathangel1479 I've forgot to ask... :s
... how to get the Slider Bar value converted as percentage?
Liked something I say?
Tip. My Bitcoin address: 1PLaeKmXQ8vEdGGJqXMq3KyB8hxeddxeSv
B
25
S
7
G
4
Posts: 326
Reputation: 3,903

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 34 guests