Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Christopher

Hi,

Should be a bit of a basic one this; sorry if I've missed something obvious in the documentation.

I have a single music track that I want to play from start to finish and then stop. By default the music seems to loop continuously - how can I prevent this?

The .loop property only seems to deal with the looping of a single track in the playlist, not the looping of the playlist itself.

Thanks,

Chris

1 decade ago by Joncom

ig.Music seems to be intended for continuous play. While I agree with you there should be an option to "stop and wait for instruction" after a song ends, there does not appear to be such an option out of the box. You could create this yourself. However the easiest solution may be to simply play a song as an ig.Sound instance instead. This would accomplish the same thing, wouldn't it?

1 decade ago by Christopher

Thanks for the quick reply!

You&039;re right - this could indeed be accomplished with an ##ig.Sound# instance. The main reason why I chose ##ig.music## is because I want an easy means to stop any music that is currently playing from various menus within the game.

This can be done easily by simply calling ##ig.music.stop## - is there an equivalent function I can call to stop all currently playing instances of ##ig.Sound##?

1 decade ago by Christopher

Oops... formatting fail

1 decade ago by Joncom

Just keep a pointer such as ig.game.current_song which holds whatever ig.Sound is currently playing. Then you could just call stop on it the say way you call stop on ig.Music.

1 decade ago by Christopher

Thanks a lot - makes sense!
Page 1 of 1
« first « previous next › last »