Play sound independent of layout

Get help using Construct 2

Post » Mon Dec 16, 2013 4:23 pm

I'm trying to make it so that the sound file plays as soon as the game is started, and keeps playing even when the layout has changed? Is this possible and if so, how would it be done?

Thanks!
B
3
Posts: 2
Reputation: 179

Post » Mon Dec 16, 2013 5:44 pm

Add an event that stops the sound right after the event that changes layout. Then in the new layout just start a new sound file playing. If your still stuck send me a reply and ill make it and sent you a link.

Keith
B
6
Posts: 13
Reputation: 376

Post » Mon Dec 16, 2013 6:22 pm

@appchogie
I think you miss interpreted his request. He is asking if a sound/music file will play through layout changes.

@deerob4
Have you tried just playing a sound on repeat(i suggest a music file) then changing the layout.

However keep in mind that on IOS sounds won't play until a touch even occurs.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Post » Mon Dec 16, 2013 6:33 pm

Before switching the layout you could save the PlaybackTime of your sound to a global variable and on start of the new layout resume the same sound with the Seek to action.

Don't know how well this works in practice as I didn't use this before.
B
33
S
12
G
7
Posts: 227
Reputation: 7,582

Post » Mon Dec 16, 2013 8:19 pm

@jayderyu your right I did mate, I replied via my mobile phone and just glanced at it.

@deerob4 One way you could do it is to have a event sheet called "music" code the event sheet to access the music/sound you want,and on each layout "include event sheet". The music will continue to play.
B
6
Posts: 13
Reputation: 376

Post » Mon Dec 16, 2013 9:56 pm

Thanks for all the responses guys!

@appchogie Your method worked, thanks very much!
B
3
Posts: 2
Reputation: 179

Post » Mon Dec 16, 2013 10:05 pm

that's ok. I make that mistake too :D

how about exploring and just play a sound. then change the layout a few seconds later?
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 12 guests