How do I detect screen orientation for a square screen ?

Get help using Construct 2

Post » Thu Apr 30, 2015 12:24 pm

No one can help me code this?
B
7
Posts: 32
Reputation: 337

Post » Thu Apr 30, 2015 12:43 pm

The Touch plugin uses that same code to get the device orientation.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Thu Apr 30, 2015 7:16 pm

Hi @Ramones, thanks for replying to me!

Well, I tried puting this very simple .capx into the watch (works perfect on the navigator with position emulator) and it just doesnt work... any idea? The tizen sdk doesnt change anything and I just do an export of my C2 game in HTML5...
B
7
Posts: 32
Reputation: 337

Post » Thu Apr 30, 2015 7:21 pm

Basically what I coded was : if alpha superior to 70 and inferior to 95, make a red square visible... this should work. Also, I have a text in the middle of the screen showing alpha, beta and, gamma, all emulated values show in the google emulator, nothing on the watch...
B
7
Posts: 32
Reputation: 337

Post » Fri May 01, 2015 11:32 pm

If anyone is still reading this: I have found that the c2runtime.js in html5 export by C2 contains the expression "screen.orientation.lock". It appears many times and I am really not a good coder so if anyone has an idea...
B
7
Posts: 32
Reputation: 337

Post » Tue May 19, 2015 2:55 pm

Set the window size to 320x319 and letterbox scale.

Then you can use Browser>Detect Orientation.
B
24
S
7
G
1
Posts: 186
Reputation: 2,716

Post » Tue May 19, 2015 7:48 pm

@aquinn I just tried that on the watch and in doesn't work... I guess the browser object is not compatible... thanks for trying to help, I didn't expect help here anymore...
B
7
Posts: 32
Reputation: 337

Post » Tue May 19, 2015 7:53 pm

I was really hoping that I could work with alpha, beta and gamma but I'm not a good coder enough I guess
B
7
Posts: 32
Reputation: 337

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests