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.

iOS and MacOS / [Tier2] iOS Launch Screen Orientation + Scaling issue

Author
Message
erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 27th Sep 2012 05:27 Edited at: 27th Sep 2012 05:29
Hello,

I've seen lots of threads about orientation and scaling issues and read (I think) all of them.

However my issue seems a *tiny* bit different.


- My app is designed for 960x640 virtual resolution
- Everything works fine on iPhone
- The problem happens specifically on iPad

Here's what happens.

- the game launches and displays the 'default.png' just fine which is designed specifically for the iPad's resolution
- my main menu screen loads in the proper landscape orientation
- HOWEVER it is squeezed down to half its size (from top to bottom)
- it will stay this way until I rotate the device, at which point it will change orientation and snap to the proper scaled size immediately!


So the app is capable of scaling it correctly, and does it once an orientation change is detected -- but I really want it to be scaled properly on launch.

Having it be messed up on first launch like this is going to make the people buying the game feel like its poorly done so this is a big deal for me!

Here is the area where I set up the resolution and orientations




Thanks for any help in advance, I'm ready to upload my app except for this issue So I'm quite eager to see this resolved!

EDIT:

I am using the 1076 templates with Ancient Lady's XCode4 iOS6 updates.
erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 27th Sep 2012 08:05
After further desparate forum scraping I see my issue is similar to the thread: Problem with autoresize screen iPad.

http://forum.thegamecreators.com/?m=forum_view&t=199680&b=44

I just would not have read that one by its description did not make sense to me. But what is being described there is exactly the problem I'm having.

None of the advice in that thread seems to be working.

Again ; on iPhone no problem.
On iPad ; initial screen is compressed in one of its axis's.
Manually tiling the device up and down changes orientation and fixes it automagically.

Any help appreciated!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 27th Sep 2012 16:43
In your Xcode setup, there are two sections where you set the supported orientations, one for iPhone and the other for iPad.

Are you sure that you set both sections to only landscape?

Also, add these lines to your <yourproj>-Info.plist:


And update your start up code to this:


This combination should force your app straight to landscape, it's what happens in mine.

Cheers,
Ancient Lady
AGK Community Tester
erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 27th Sep 2012 16:57
@Ancient Lady: my info.plist already had that.

The only perceptible change to my startup code is changing the orientation from 4 to 3 (both are landscape modes)

But same problem.

I wonder if some of my project files are different from yours?
erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 27th Sep 2012 17:06
Another finding from testing last night.

If I comment out the line

agk::SetOrientationAllowed( 0,0,1,1 );

Then all of a sudden it no longer sits & waits on the AppGameKit splash for me to turn the screen and force an orientation change.

Instead it instantly pops up on the main menu but its in portrait mode and because the images are truly landscape mode it is scaled down in all dimensions.

And then of course further turning of the device will not permit orientation changes.

Dont know if that helps
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 27th Sep 2012 17:20
Quote: "I am using the 1076 templates with Ancient Lady's XCode4 iOS6 updates."

Are you using the Xcode 4 files from the templates I posted here?

They have the proper 1076 files (the Tier 2 templates in the 1076 installation are NOT up to date), plus a couple of my own tweaks (as described in that post).

The 'shouldAutorotateToInterfaceOrientation' method in your UntitledViewController.m file should look like this if you are using the correct 1076 files:


My tweak switches the 3 and for the landscape checks to fix a misunderstanding between AppGameKit and iOS about which way the landscape orientations go.

If your file doesn't look something like that, you are not using the correct v1076 files. See my post for updated template files and which files you need to change.

Cheers,
Ancient Lady
AGK Community Tester
erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 28th Sep 2012 04:59
Quote: "Are you using the Xcode 4 files from the templates I posted here?

They have the proper 1076 files (the Tier 2 templates in the 1076 installation are NOT up to date), plus a couple of my own tweaks (as described in that post).
"


Yes that is what I did ; however I will start over from scratch and do it all again if we think that will fix it somehow.

Just got back from work, I'll update in an hour or so have to get the little one to bed shortly
erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 28th Sep 2012 08:05
So .. I had been holding off updating to iOS6 on my iPad as I wanted to test both iOS5 and iOS6.

Imagine my surprise when I updated to iOS6 I no longer have this problem.

So interestingly enough this particular problem appears to be an AppGameKit + iOS6 + Tier2 template problem.

Unfortunately now I dont know how to roll my iPad back to iOS 5 to check the problem further but its nice to know all iPad's are elligible for iOS6 so none of my customers have an excuse why this isn't a valid fix if they complain!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 28th Sep 2012 16:38
I did not see that you used the command agk:rientationChanged in your startup code. Did you try that?

I have one device as iOS 6 and one as iOS 5.1 and they both work fine with single orientation apps.

As per Apple requirements, I have the IOS Deployment Target set to 4.3 (set under Info for PROJECT).

This is the entire template.cpp file for my single orientation test:


The header (as per my posted tier two template):


Cheers,
Ancient Lady
AGK Community Tester
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 28th Sep 2012 16:42
Which version of iOS do you have on your iPad? I have my iPad as 6.0 and my iPod Touch as 5.1.

Cheers,
Ancient Lady
AGK Community Tester
erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 28th Sep 2012 17:04
Well now both my iPhone 5 and iPad 2 are both iOS 6.

My iPad had been iOS 5.1 which was not working.

Without changing anything in my project - only updated to iOS6 now it works.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 28th Sep 2012 17:52
It is probably because, when you updated Xcode, it set the deployment target to 6.0 by default and that wasn't going to work well on a 5.1 device. That is my guess.

Cheers,
Ancient Lady
AGK Community Tester
erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 29th Sep 2012 04:27
Well I had set it to target 5.1, where it is at now.

I saw your post saying to set it to 4.3? That's required by Apple somehow?

I was unclear on the reason for that but was going to try it in a bit (son's busy on the Mac right now so cant at the moment)
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th Sep 2012 18:24
Someone posted somewhere that Apple required 4.3. But I cannot be certain that that is written in stone. I suppose the reason would be for compatibility with older iOS devices.

If you have it set for 5.1, it should work.

One of the things I discovered is that it is a good idea to clean the project before building/running when you change the Xcode template target. I always have problems if I build/run on a simulator and then just try to run on a connected iOS device. But it works if I clean the project and then build/run on the device.

Cheers,
Ancient Lady
AGK Community Tester
erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 21st Oct 2012 22:58 Edited at: 21st Oct 2012 22:58
So I have had reports of people still having this problem and a friend of mine had an old iPhone 3GS that he let me borrow.

Indeed this problem still happens!

I did some further code hunting and what I am seeing is a little interesting.

If you refer to Ancient Lady's updated ios xcode 4 templates here.

The UntitledViewController.m file has the following 'fixed' code



I used this template and it is not working on that device for me.

So I did further research and I found that in the Core.m file has this



Notice how the order of mode's is different even in Ancient Lady's template.

I tried changing the Core.m file's order to the same as Ancient Lady's fix but this had no effect.

I then tried un-doing Ancient Lady's fix ; also no effect.

Its unclear if this is even the real problem but since I found this area where it is not changed I suspect we don't undertand the full ramifications of Ancient Lady's fix perhaps? Why does the fix work for the most part if the Core.m calls it out the old way still?

As this continues to be a problem for my customers on iPhone 3gs its a big priority for me and the only open bug I have for the product.

I would definitely appreciate any ideas, help, pointers, pro tips, suggestions that I can test to help get rid of this problem.

xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 22nd Oct 2012 17:29
My template work on all devices.
Just look at it.

Long life to Steve!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 23rd Oct 2012 01:23
My fix was to deal with a misunderstanding between AppGameKit and iOS about which direction each of the landscape modes go.

According to the documentation:


'landscape' is orientation 3, 'landscape2' is orientation 4.

It can safely be assumed, I would think, that 'rotated left' implies that they are talking about the top of the device going to the left.

Apples definition of the two modes is LandscapeLeft (the home button is on the left, device top rotated to the right) and LandscapeRight (the home button is on the right, device top rotated to the left).

Based on this, iOS LandscapeRight is AppGameKit landscape2 (orientation 4) and iOS LandscapeLeft is AppGameKit landscape (orientation 3).

When I was having difficulty getting my fixed landscape orientation 3 to stick, I created a test to show what agk orientation the device reported for each way that I held the device and verified that the two landscape modes were flipped.

So, I made the change only in the UntitledViewController.m file and the problem disappeared.

The reason I didn't change the Core.m file is because it is using only iOS constants. When I made the same 3/4 swap in that, my orientation issue reappeared.

Since I only changed two constant values (3 and 4), changing them back to the original AppGameKit values is easy, if you think that will fix issues for you.

Cheers,
Ancient Lady
AGK Community Tester
erebusman
12
Years of Service
User Offline
Joined: 23rd Jul 2011
Location: Sacramento, CA
Posted: 23rd Oct 2012 05:47
Quote: "Since I only changed two constant values (3 and 4), changing them back to the original AppGameKit values is easy, if you think that will fix issues for you."


No I already tested that - as explained in my post I reverted them and it had no effect on the problem.

I also re-downloaded the AppGameKit 107 zip files, freshly extracted the template, then your updated xcode 4 template I copied over the top yet again, rebuilt my project again and only put in the template.cpp file ; same problem.


I hope my post did not come across as an accusation; I just mention your name because you've pioneered this issue the most in the forums!

Naturally I was hoping you would see it ; and might be interested or knowledgeable enough to explain why the items in the Core.m file did not match; and you were able to do so - thank you for the explanation.

It does however leave the issues unresolved.

And .. I am not the only person to have this issue; so I'm not quite crazy! And have it 'go away' mysteriously and then come back is extremely frustrating.

I think *something* is doing it and we'd all be better off identifying it.

My problem is I've only been coding for 9 months so I can definitely not be looking at the right things. I'm totally willing to invest time but being pointed in the right direction is way more productive than just randomly trying to find a needle in a haystack

Thanks for your continued input and advice on the matter.

@xGEKKOx ; I am going to under take that next; but your template includes a lot of things I don't understand and not sure what the ramifications are. I'm willing to try it out ; and hope to tackle that this upcoming weekend but when I tried to copy your untitledcontrolviewer I got a bunch of errors; so obviously I have to use it 'all or nothing'.. I do not have ads, I do not have gamecenter, etc.. so I'm worried those items in your template will flag my app as using those things when I have no support? I don't know if thats an unreasonable concern ?

xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 23rd Oct 2012 12:59
Don't worry, just ask for clarifications.
Anyway Ads and GameCenter in my templates are not required.
They are required only if you call the related functions.
If you don't call those functions it work just as normal.

The difference in my template is the #include / #import sequence, that is the important part to mix all.
And some LIB that in the old template aren't included as mistake.

Long life to Steve!

Login to post a reply

Server time is: 2024-04-19 14:01:21
Your offset time is: 2024-04-19 14:01:21