Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Orientations & resolutions

Author
Message
Gibbon28
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location: Derbyshire, UK
Posted: 22nd Oct 2012 16:54
Hi, im new here and just trying to get my head around resolutions?

I think the first thing is, does AppGameKit currently support iphone 5 resolution? As i cant seem to get it to run usnig 1336 x 640, but i can at 960 x 640?

Also if i set that as my virtual resolution to 640 x 960 (iphone res) how can i set the actual resolution of the viewing window on my PC?

Andy finally, i want to create an app that is landscape only? What do i need to do to achieve this on both my pc (for testing) and devices?

Ive found the SetOrientationAllowed command, but how about the PC for testing?

Thanks
Andy
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 23rd Oct 2012 01:46
Quote: "how about the PC for testing"

There is no way to change the orientation being viewed on the PC. At best, you can change the width and height. On the PC, you will need to edit the setup.agc file to set the width and height to what you using in your SetVirtualResolution call. The PC is the only platform that uses the setup.agc file.

Quote: "i cant seem to get it to run usnig 1336 x 640"

How are you testing on your iPhone 5?

Assuming you are using Tier 1, this is something like what you would do at the beginning of your app for a landscape orientation:


When you get around to building your Xcode tier 1 project, you would edit another (iOS specific) file that would tell the app that it is only allowed to use the landscape orientations.

Cheers,
Ancient Lady
AGK Community Tester
Gibbon28
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location: Derbyshire, UK
Posted: 23rd Oct 2012 10:38
HI Thanks Ancient Lady.

Here is what im experiencing, if i create a new project i can create a landscape or portrait, either doesnt really matter but the option is there.

So if i create a landscape by setting the width and height (which is what ive done) that works great windows.

When i broadcast this to my iphone for the player, the result is a small landscape window with the phone in portrait mode (big black areas top and bottom) and when i turn the phone to landscape nothing happens (left or right). So how using the player do i get it into landscape on my phone?

The iphone 5 resolution issue is, if i simple set the virtual res and width/heigh in setup to the iphone 5 res it results in the display being offset with black regions top, bottom and left, almost like it doesnt like the aspect ratio of 1336x640. but 960 x 640 works fine?

Thanks
Andy
Ian Rees
AGK Developer
12
Years of Service
User Offline
Joined: 3rd May 2012
Location: Wales, UK
Posted: 23rd Oct 2012 15:23
The iPhone 5 resolution is 1136 x 640.

I am using 1136 x 640 which seems to work fine, although I haven't tested on the iPhone 5 yet.

E
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 23rd Oct 2012 15:42 Edited at: 23rd Oct 2012 15:43
Are you setting the correct aspect?

setDisplayAspect( 1.775 ) would be correct for iPhone 5 if it's 1136x640, for landscape mode.

EDIT: Sorry just noticed you're not using percentage system

My hovercraft is full of eels
7RS
11
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 23rd Oct 2012 16:07
I got a similar problem and seem that you need to invert width and height when you make any calculation... Seem that in landscape the w/h are not swapped.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 23rd Oct 2012 16:16
I have only had android to test on myself, but do have a ios game published via TGC. Have you tried setting the orientation to landscape in your tier 1 program? On android you can lock it to one or the other if needed, I'm not sure if it will behave the same on iphone, but can't see why not. I am guessing you are using the broadcast feature and not compiling it at the moment.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 23rd Oct 2012 16:29
Gibbon28, the selecting landscape vs portrait for windows only sets the values in the setup.agc file. This information does not translate to any other platform or to a player running on a device.

You still haven't told me how you are testing on your iPhone. Are you using a Player or do you have a Mac and Xcode and are building and running the app directly? This makes a difference.

We have recently discovered that Xcode 4.5.1 does not work well with AppGameKit orientation. It is recommended to stick with Xcode 4.4 until TGC can figure out what Apple changed and accomodate it.

And, did you put the SetOrientationAllowed command in?

Cheers,
Ancient Lady
AGK Community Tester
Gibbon28
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location: Derbyshire, UK
Posted: 23rd Oct 2012 17:26
Hi Aceient Lady, i mentioned in my last post how i was testing:

Quote: "When i broadcast this to my iphone for the player, the result is a small landscape window with the phone in portrait mode (big black areas top and bottom) and when i turn the phone to landscape nothing happens (left or right). So how using the player do i get it into landscape on my phone?"


Ok so the resolution is so much of an issue now, it works ok in Windows! But how using the AppGameKit player can i broadcast a app to be viewed only in landscape, or at the very least work in landscape?

Thanks
Andy
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 23rd Oct 2012 18:41
If you lock the screen to landscape using the setorientationallowed command. It should start up in the correct mode. I am unsure why it isn't flipping when you tilt the device though as that should be working by default. Perhaps it is the project settings? I always start off using a generic project and setting the resolution using the setvirtualresolution command. Aspect ratio settings could be causing the problem possibly. For sure you don't want to combine both commands at any time. That can cause issues.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 23rd Oct 2012 19:01
Gibbon28, sorry, I must have missed that.

I am assuming that your iPhone 5 is also iOS 6.0.

Apple changed how iOS 6.0 handles orientation and it isn't quite the same as previous iOS versions.

If you don't put in the SetOrientationsAllowed command, the Player definitely won't flip automagically.

I just tested my app that is landscape only on a v1076 Player on iOS 5.1 and iOS 6.0 devices. And it would not rotate in the player automatically. But, when the project is built in Xcode and run on the devices, it worked. And I did the tweaks similar to what is described below.

When you get to the point where you are building in Xcode, there are two things to keep in mind.

The first is make sure you don't use Xcode 4.5 and do use Xcode 4.4. Apple made changes in Xcode 4.5 to accomodate iOS 6.0 that are not compatible with the AppGameKit orientation control. I was able to definitively prove that using Xcode 4.5 is a problem (some other post).

Second, there is a small tweak to be made in the Classes/UntitledViewController.m file specific to your desire for a landscape only mode:


The above code is not my tweaked version that takes into account the difference of opinion about landscape orientations between iOS and AGK. It is one that will specifically allow only the two landscape modes.

There are some other Xcode settings that will help make sure your app works only in landscape, but we can go into them later (or you can search for the discussions in this forum).

Cheers,
Ancient Lady
AGK Community Tester
Gibbon28
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location: Derbyshire, UK
Posted: 23rd Oct 2012 19:28
Hi Ok this is all i have at the start of my code:

// Landscape App
SetVirtualResolution(960,640)
SetOrientationAllowed(0,0,1,1)

This runs in landscape in windows, when broadcasted to iphone it runs but as landscape in portrait mode (so not landscape).

If i rotate the phone nothing happenes, even when i comment out SetOrientationAllowed.

Thanks
Andy
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th Oct 2012 00:52
As I said, the iOS Player doesn't quite respond to that SetOrientationAllowed command properly, especially on an iOS 6.0 device.

I broadcast the same app to two Android devices (3.2 and 4.1) and both rotated to the correct orientation once loaded and started.

When broadcasting to an iOS 6.0 and an iOS 5.1 device (iOS v1076 Player), it would not rotate.

But, as said before, when you build the app with Xcode, you can do things which will force the orientation properly.

Cheers,
Ancient Lady
AGK Community Tester
Gibbon28
11
Years of Service
User Offline
Joined: 22nd Oct 2012
Location: Derbyshire, UK
Posted: 24th Oct 2012 12:08
I see, thats for the help Ancient.

Ill get Xcode put on to my mac book then and test it that way. I suppose that is a more accurate test too as abosed to the broadcast.

Although one of the selling points of AppGameKit to me was the instant testing facility it advertises using the broadcast feature, which is now dissapointing.

Thanks
Andy
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 24th Oct 2012 16:54
Gibbon28, you'll need to find the download site for Apple and get the Xcode 4.4(.1?) version (a big download). Builds using the current version of Xcode (4.5.1) will not work properly for orientation setting. Apple made a change to accomodate iOS 6.0 and it messed up something AppGameKit was doing.

And you can instantly test iOS apps, the only issue is when you do a forced landscape. Android tests on the Players are not a problem.

I might post the iOS issue on the google list later.

Cheers,
Ancient Lady
AGK Community Tester

Login to post a reply

Server time is: 2024-05-03 22:17:50
Your offset time is: 2024-05-03 22:17:50