Detection landscape or portrait

Get help using Construct 2

Post » Fri Jul 12, 2013 7:34 pm

Hi,

is possible detect that device is landscape or portrait? I want to make this, when device is portrait, i want to show massage: "please rotate device landscape". Is this possible now in construct?
B
25
S
4
G
2
Posts: 318
Reputation: 2,501

Post » Tue Jul 23, 2013 1:35 pm

No exist?
B
25
S
4
G
2
Posts: 318
Reputation: 2,501

Post » Tue Jul 23, 2013 1:44 pm

you could compare windowwidth and windowheight. if windowwidth < windowheight set timescale to 0 and display rotate message. This is only usefull if you're using scale and fullscreen-mode i think.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jul 23, 2013 7:55 pm

It does not work for me :( i use letterbox scale and i tryed other fullscreen modes too...
B
25
S
4
G
2
Posts: 318
Reputation: 2,501

Post » Tue Jul 23, 2013 9:06 pm

You can use the default Browser plugin and do something like:
[code]System: Browser.ExecJS("window.innerWidth") < Browser.ExecJS("window.innerHeight")
    -> display your message[/code]
B
66
S
22
G
14
Posts: 1,484
Reputation: 16,511

Post » Thu Jul 25, 2013 11:49 am

Thanks Yann, it worked :)
B
25
S
4
G
2
Posts: 318
Reputation: 2,501


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, David181, fens and 12 guests