[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.5.6 Mix_FadeInMusic

int Mix_FadeInMusic(Mix_Music *music, int loops, int ms)

Pointer to Mix_Music to play.
number of times to play through the music.
0 plays the music zero times...
-1 plays the music forever (or as close as it can get to that)
Milliseconds for the fade-in effect to complete.

Fade in over ms milliseconds of time, the loaded music, playing it loop times through from start to finish.
The fade in effect only applies to the first loop.
Any previous music will be halted, or if it is fading out it will wait (blocking) for the fade to complete.
This function is the same as Mix_FadeInMusicPos(music, loops, ms, 0).

Returns: 0 on success, or -1 on errors.

// play music forever, fading in over 2 seconds
// Mix_Music *music; // I assume this has been loaded already
if(Mix_FadeInMusic(music, -1, 2000)==-1) {
    printf("Mix_FadeInMusic: %s\n", Mix_GetError());
    // well, there's no music, but most games don't break without music...

See Also:
4.5.5 Mix_PlayMusic, 4.5.7 Mix_FadeInMusicPos

This document was generated on November, 13 2009 using texi2html