How to make audio slider?

Hi,
I am new in cocos, ofcourse new in cocos creator,
I want to make a simple audio player with audio slider in it, but don’t see any slider UI.

is there any tutorial about how to put slider in cocos creator?

thanks

after reading the roadmap…
slider UI will available on 2016.9

so… i think i cannot using slider on Cocos Creator project

or any solution?
thanks

hiho

was looking for the exact same thing

then i thought it can’t be a big deal to write a slider in cocos creator, so i just did it in less than an hour.
I could share it if you like, but then it won’t be long until the official slider component is released.

cheers

Hi fliegenfuerst!

Actually, I’m trying to make the same thing like you, but I’m not sure how to do this :frowning:
Could you share how you did it? I really appreciate it :smiley:

Thanks!!

in about two weeks slider component will be available. but here’s my workaround anyways

the prefabs slider subnode needs a node put in it that contains a script that has a receiveSliderValue function such as the following:

ccSlider.zip (2.2 KB)

    receiveSliderValue:function(name,value){
        switch(name){
            case "sfxVolumeSlider":
                cc.log("volumeChangeSFX");
                cc.audioEngine.setEffectsVolume(value);
                break;
            case "bgmVolumeSlider":
                cc.log("volumeChangeMusic");
                cc.audioEngine.setMusicVolume(value);
                break;
        }
    },

hope this helps for the time being

cheers

Thanks!! I will try it :smiley: