plawres
plawres

Reputation: 313

SimpleAudioEngine background volume with CCActionTween

Is it possible to have a fade out effect for SimpleAudioEngine background music using the CCActionTween? I know that the volume property is an float between 1 and 0.

If it is possible, then a sample code would be much appreciated.

Thanks

Upvotes: 0

Views: 918

Answers (1)

YvesLeBorg
YvesLeBorg

Reputation: 9089

AFAIK, there are no mechanisms within cocos2d to do what you are asking about. A CCNode derivative has the runAction method, but there are no CCNode derivatives for that embed sound controls. I perform sound fade in-out in the main loop as shown here . The method fadeOutBackgroundMusic is exposed by a singleton, and available anywhere in the code. It has a corresponding fadeInBackgroundMusic method.

Upvotes: 1

Related Questions