How do I change the music playing?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
How do I change the music playing?
There would be a separate theme for the menu and the game itself in a game i'm making, how do i make the menu music alternate to the gameplay music?
- CogentInvalid
- Prole
- Posts: 27
- Joined: Sat Dec 14, 2013 12:15 am
Re: How do I change the music playing?
You would load both audio files with love.audio.newSource, play the menu music with love.audio.play, and, when going to gameplay, stopping the menu music with love.audio.stop and using love.audio.play to play the gameplay music.
-
- Party member
- Posts: 548
- Joined: Wed Oct 05, 2016 11:53 am
Re: How do I change the music playing?
Additionally, if you want a smoother transition between the menu and gameplay tracks by fading them in/out over time, you can either use love.audio.setVolume (to set the master volume), or individually set the volume for each track with Source:setVolume.
Who is online
Users browsing this forum: Bing [Bot] and 4 guests