Play BG Music on iOS 6(Safari) and use Fullscreen?

Get help using Construct 2

Post » Fri Dec 06, 2013 8:13 pm

Hi! The manual says you need a manual input before sound is played so I created a "Touch to begin" overlay above my title screen. But I have to touch the display of my iPod twice to make the music play.

I have the following events (added trigger once but does not seem to change anything):
Touch: Is touching [T]Launch
> System Trigger once:     Audio Play Title looping
              [T]Launch Set Invisible
              TiledBG Set Invisible (black overlay hiding the title screen)

The overlay (text and black tiledbg) disappears on first touch but sound only starts after a second touch. Does anyone know why or how to fix this?


And I tried to add a Request Browser Fullscreen Centered and Scale Outer as well and set project options to "Landscape" but it does not seem to do anything on Safari on iOS 6 (7 not working on my iPod 4th Gen.). After the first tests it was filling the screen properly even without the fullscreen request working (as far as I can tell) but now it has an empty bar on the bottom. I did not change the size of the canvas and don't know where it comes from. Bl4ckSh33p2013-12-07 07:30:45
Bl4ckSh33p-Soft - Custom Software and Indie Games
B
55
S
16
G
6
Posts: 735
Reputation: 9,269

Post » Fri Dec 06, 2013 8:24 pm

Regarding Scaling I just found something in the example "Fullscreen - scaling to window size". It uses "Scale" as scale setting which is not in the dropdown list, only Scale inner/outer are listed there. And I cant seem to enter text in the field.

I changed "Unbounded scrolling" which seems to fix the aligment, its centered now (but still having this black bar I didnt have before). :)

But is there no way to automatically use landscape/fullscreen mode on Safari on iPod/iPhone?

/UPDATE:
I changed the code a bit because the music was playing everytime I touched the display despite using "do once" (object was only invisible not removed). I changed it to "Destroy" and it does not play multiple times anymore but it is still not playing after the first touch. I have to touch the display a second time and then it plays (but the object starting the music is already destroyed).



Or is there no way to do this in Safari and I have to use CocoonJS?Bl4ckSh33p2013-12-07 07:30:05
Bl4ckSh33p-Soft - Custom Software and Indie Games
B
55
S
16
G
6
Posts: 735
Reputation: 9,269

Post » Sat Dec 07, 2013 12:23 pm

I think there might be a bug in the Audio plugin where it still queues music for the next touch in a touch event. You can just play music on the start of layout and the Audio plugin will actually start playback automatically upon the first touch - you don't need a specific event to handle it. I'll update the manual to clarify this.

'Trigger once' doesn't trigger once ever, it just means 'only run if the event did not run last tick' and therefore makes no sense to use in a subevent to a trigger. Use a global variable for that kind of thing instead.
Scirra Founder
B
398
S
236
G
88
Posts: 24,428
Reputation: 194,600

Post » Sat Dec 07, 2013 12:50 pm

Ok, I will try to add it to "on start" of the layout.
Thanks for pointing that out.
Bl4ckSh33p-Soft - Custom Software and Indie Games
B
55
S
16
G
6
Posts: 735
Reputation: 9,269


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 41 guests