Sometimes, it is good to add a volume slider to your game so that the player has the freedom to reduce it if he or she finds it a little too loud. In this section, we will discuss how to add a volume slider to our game in the options menu.
To add a volume slider, we will need to import the
sliderHandle.png files into our project.
Right after where we added the toggle button to mute the audio, we will add the following code:
//slider CCSpriteFrame *sliderBase = [CCSpriteFrame frameWithImageNamed:@"sliderBase.png"]; CCSpriteFrame *sliderHandle = [CCSpriteFrame frameWithImageNamed:@"sliderHandle.png"]; CCSlider *slider = [[CCSlider alloc]initWithBackground:sliderBase andHandleImage:sliderHandle ...