music continues between layouts?

For questions about using Classic.

Post » Mon Aug 03, 2015 12:13 am

I saw someone answer this and said something about audio tags. I don't know what that is though...I want the music to continue between 4 layouts( and loop)...are you supposed to use global variables or something? I am a noob with no programming experience so you'll have to go REALLY slowly...
B
23
S
10
G
6
Posts: 72
Reputation: 4,875

Post » Mon Aug 03, 2015 1:06 am

I am pretty sure that unless you ask your music to stop, it will continue to play even when changing layouts. If you just want your music to continuously play throughout the game, you don't really need to use globals. Only use them when you want the music to stop, mute, or switch music tracks.
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Mon Aug 03, 2015 4:21 am

if that was the case I wouldn't have posted the topic in this forum... on start of layout i put "autoplay resource from file (loop)" and it doesn't transition to another layout
B
23
S
10
G
6
Posts: 72
Reputation: 4,875

Post » Mon Aug 03, 2015 5:17 am

Actually it does automatically continue to play the music when you go to another layout. Few things you might want to have a look at.

Is your music in the proper music folder? Also you mention "autoplay resource from file(loop)", I don't know what action this is cause I can't find it at all. Are you using the Audio Object? All you need to do is use the "Play" action and select loop. As long as your other layouts do not issue the Audio object any new actions, it will continue to play the music.
B
46
S
23
G
31
Posts: 693
Reputation: 20,637

Post » Mon Aug 03, 2015 6:09 am

@rekjl
I think he's using construct classic, not construct 2.

@pillaystation
By default the xaudio2 plugin is not global so it gets destroyed when the layout ends.
Make the object global (It's an object property) so it won't be destroyed when the layout changes.
If you do that you next need to make sure there is only one xaudio2 instance. The usual way is to only have it in the first layout your game runs and on none of the other layouts.
B
94
S
33
G
113
Posts: 5,357
Reputation: 73,275

Post » Mon Aug 03, 2015 7:30 am

R0J0hound wrote:@rekjl
I think he's using construct classic, not construct 2.
other layouts.


Really sorry, I just noticed it was in the Construct Classic section.
B
46
S
23
G
31
Posts: 693
Reputation: 20,637


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests