HTML5 Portrait on android

Get help using Construct 2

Post » Wed Nov 12, 2014 11:50 am

Hello
I have a problem here:
I have a HTML5 web application running, access it with a PC and a smartphone (android), I would when I acess whith a smartphone him to stay fixed in portrait orientation , I can do this ?

I'm trying to do it for there are several text boxes on the application and when I access it by a smartphone , the default keyboard takes over the entire screen, in portait it picks up the black bottom, if you have a solution to this would also be interesting

thanks :)
B
5
Posts: 34
Reputation: 322

Post » Wed Nov 12, 2014 1:31 pm

In Chrome for Android, the project 'Orientations' property is respected, but only after you request fullscreen with the Browser object. Also note you can only request fullscreen in an input trigger, e.g. 'On sprite touched' or 'On any touch start'.
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,684

Post » Wed Nov 12, 2014 2:25 pm

This work just with the Chrome?
anyway, I could not make it work

im using:
on start of layout - request fullscreen
Browser is full screem - lock orientation to portrait

oriantation property is portrait also
B
5
Posts: 34
Reputation: 322

Post » Wed Nov 12, 2014 2:45 pm

'On start of layout' is not an input trigger. It has to be an action initiated by the user, otherwise the browser ignores the request. You also don't need the other event to lock orientation, Construct 2 does that automatically if the project orientations property is set.
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,684

Post » Thu Nov 13, 2014 10:43 am

Yeah, for Chrome worked perfectly
have any way for other browsers?

Thanks a lot
B
5
Posts: 34
Reputation: 322

Post » Thu Nov 13, 2014 2:06 pm

AFAIK in other browsers, you cannot curenttly force it (as they did not yet implement this feature), you could detect if it is portrait or landscape, depending on the result, suggesting to the user to rotate their device for a better experience.

Also not all smartphones (I think) have a keyboard that covers the entire screen on landscape mode.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Thu Nov 13, 2014 2:16 pm

I think it's also supported on Firefox for Android and IE11 on Windows Phone 8.1, but Safari on iOS and the Android stock browser on old Androids don't support it.
Scirra Founder
B
395
S
231
G
88
Posts: 24,367
Reputation: 193,684

Post » Thu Nov 13, 2014 2:27 pm

hum, okay , I'll find some other solution to the keyboard and landscape, Thank you for your attention :)
B
5
Posts: 34
Reputation: 322


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests