Intel XDK - orientation problems

Ideas and discussion about publishing and distributing your games

Post » Mon Mar 09, 2015 2:28 pm

Hi everyone,

Could anyone give me a quick run-down on how to lock orientation to landscape when exporting using Intel XDK. I've the project properties to landscape in C2 and edited the build settings - orientation in Intel XDK however it still doesn't lock to landscape.

I've also tried experimenting with inputting the following into my Index.html file however I'm not really sure where to put it or even if I'm inputting the right thing:

intel.xdk.device.setRotateOrientation("portrait");
intel.xdk.device.setAutoRotate(false);
intel.xdk.device.hideSplashScreen();


Any help would be much appreciated!

Kind Regards,
Vega
Mega Game Studios is a tiny independent game studio run from our apartment in Melbourne, Australia. We're not quite sure what we do yet but we think it has something to do with apps, board games and plush toys.

www.megagamestudios.com
B
18
S
7
G
3
Posts: 85
Reputation: 2,920

Post » Mon Mar 09, 2015 6:51 pm

intel.xdk.device.setRotateOrientation("portrait")?
Why "potrait"?
B
11
S
3
G
1
Posts: 91
Reputation: 997

Post » Mon Mar 09, 2015 7:02 pm

intel.xdk.device.setRotateOrientation("portrait");


be sure when you compile your game with XDK to change the settings for orientation, the old version its easier to use, the new one its kinda weird.

even though you made the changes in your Capx project to landscape or portrait, before you compile, you need to go to Intel XDK project settings, and change game orientation, any settings that you change in Intel XDK will overwrite your Capx project settings.
B
78
S
23
G
69
Posts: 1,353
Reputation: 44,005

Post » Mon Mar 09, 2015 8:39 pm

Thanks for the reply guys.

@Bouncytrip
Sorry I was just messing around with it to see if it did anything. I've tried both landscape and portrait and either way it doesn't lock.

@gamecorpstudio
As specified in the original post, I've changed the project settings in intel XDK.

Any other suggestions?
Mega Game Studios is a tiny independent game studio run from our apartment in Melbourne, Australia. We're not quite sure what we do yet but we think it has something to do with apps, board games and plush toys.

www.megagamestudios.com
B
18
S
7
G
3
Posts: 85
Reputation: 2,920

Post » Mon Mar 09, 2015 8:57 pm

That's so strange...
Have you set "Landscape" to the Crosswalk Build as in the image?
5y5y5y5y5y.png

Select the crosswalk build only.
Also, have you updated XDK to the 1816 version?
You do not have the required permissions to view the files attached to this post.
B
11
S
3
G
1
Posts: 91
Reputation: 997

Post » Tue Mar 10, 2015 9:06 am

@BouncyTrip

Thank you so much for taking the time to help me out.

My Intel XDK version is 1816. I hadn't touched the android/crosswalk or windows options yet as I'm mainly trying to get it to work on my iPad at the moment. Tried setting the orientation option on the crosswalk build settings to landscape today and I'm still able to rotate the orientation on my iPad. The iOS build settings are obviously also set to landscape.

I wonder if my problem has to do with where in the index.html file I input the code. I've tried multiple things. Any chance you could give me a hand?

Here's two screenshots of my index.html file:

Image

Image
Mega Game Studios is a tiny independent game studio run from our apartment in Melbourne, Australia. We're not quite sure what we do yet but we think it has something to do with apps, board games and plush toys.

www.megagamestudios.com
B
18
S
7
G
3
Posts: 85
Reputation: 2,920

Post » Tue Mar 10, 2015 2:49 pm

I know little about coding, but Index seems to lack of a line that specifies to set the game on landscape...
May I ask you some questions? :)

1- Have you checked if the config file inside your exported project folder specifies the landscape mode? (mine is potrait)

Cattura di schermata (32).png


2- When importing your project to Intel XDK, do you choose Yes to both the questions at this popup window?

Cattura di schermata (30).png


3 When exporting, do you specify the supported devices as universal? Is your iPad running iOS8?

Cattura di schermata (31).png


Also, have you tried to export without minifying?

I hope it will help :)
You do not have the required permissions to view the files attached to this post.
B
11
S
3
G
1
Posts: 91
Reputation: 997

Post » Tue Mar 10, 2015 8:19 pm

@BouncyTrip

1 - My config file does specify landscape.

2 - I can't remember what I specified for 'hybrid app project'. Game project however was set to yes. What does hybrid app project do?

3 - Supported devices is set to universal, I'm running on iOS 8.

And I'm also exporting without minifying.

The index file I showed you in my last post was my basic code, not including the line which is supposed to lock the orientation. I have however tried adding this line in various different places. I found the appropriate code my searching Intel XDK forums online. The line is:

document.addEventListener("intel.xdk.device.ready", onDeviceReady, false);
function onDeviceReady(){
intel.xdk.device.setRotateOrientation('landscape');
intel.xdk.device.setAutoRotate(false);
intel.xdk.device.hideSplashScreen();
}

Is this the correct line to input? Where in my above code should it go?

Thanks again for helping!
Mega Game Studios is a tiny independent game studio run from our apartment in Melbourne, Australia. We're not quite sure what we do yet but we think it has something to do with apps, board games and plush toys.

www.megagamestudios.com
B
18
S
7
G
3
Posts: 85
Reputation: 2,920

Post » Tue Mar 10, 2015 10:29 pm

Sorry but I can't help you with code :(

The only thing I can suggest is to delete the actual exported project folder, create a new cordova minified export, set "Yes" to hybrid app project when importing to xdk, keep the "device" plugins always active, and as usual set the orientation to landscape in construct and in xdk...

Let me know if it works :)
B
11
S
3
G
1
Posts: 91
Reputation: 997

Post » Sat Mar 14, 2015 11:56 pm

@BouncyTrip

Tried redoing the whole game and still no luck. Good news is in the end I paid the $25 and downloaded cranberrygame's plugins and it worked straight away :)

The description on this particular plugin says "fixes screen orientation bug in iOS" so I'm guessing its a common problem. Thanks for all the help though!
Mega Game Studios is a tiny independent game studio run from our apartment in Melbourne, Australia. We're not quite sure what we do yet but we think it has something to do with apps, board games and plush toys.

www.megagamestudios.com
B
18
S
7
G
3
Posts: 85
Reputation: 2,920

Next

Return to Distribution and Publishing

Who is online

Users browsing this forum: No registered users and 0 guests