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 / Orientation, Startup and Exiting problems

Author
Message
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 3rd Jun 2012 21:53
This is all with v1075.

The first problem is associated with the now deprecated splash screen. I removed AGKSplash.png file, created my own (for now a test page) and added this code to the top of my main.agc file, before anything else:


On Mac, the loading happens so fast that the first thing I see is the next 'loading' display. On Windows, I get a brief white screen, followed by "mysplash.png" showing briefly, followed by my main menu.

On android, I get a black screen for a couple of seconds, then "mysplash.png" appears.

On the iOS devices, I get the Default-landscape.png page, followed by a second of white screen, followed by a couple of seconds of black screen. The "mysplash.png" file never appears. I have tried it with and without "/media/" and with "media/" in the load and it doesn't work any way.

The second problem is related to orientation. The game I'm developing really depends on the orientation being kept in landscape and not flipping to any other, including the other landscape.

We finally got this working correctly on the Android device I had (and hopefully helping everyone else with an odd ball android device with the next release).

In the code I explicitly set the allowed orientation 3 (as indicated in the first problem): SetOrientationAllowed(0,0,1,0)

This should force only landscape where you rotate to the left from normal portrait.

Within my Xcode 4 project, I specifically only allow one orientation, rotated left, with the menu button ending up on the right. And just to confuse everyone, Xcode calls this 'Landscape Right'. I assume it is because that is where the menu button ends up.

I was showing the current state of the game to my hubby on my iPod Touch and when I tilted it severely away from me, it flipped to to the other landscape, orientation 4. And I could not get it to flip back the other way.

At that point, the values for the accelerometer still reported as if it was orient 3. But the button locations behaved properly, so I could cleanly exit the app.

I tried changing the xcode setting to the other landscape only, and that only confused it further. The app started one way, flipped the other, and then flipped when tilted.

When both the code and the xcode setup specify exactly one orientation, it should not allow any other.

That problem is not insignificant. It occurred on all three iOS devices I tested on: iPod Touch, iPad2 and iPad3 (my hubby lets me use is device for testing).

The third problem is when I use the exit button on my app to exit. The game display disappears and a black screen shows up. And then it takes 30-40 seconds before the black screen disappears and the app menu page appears. If I use the menu button during the black screen, I get back to the menu okay. But when I click on my app again, it is still in black screen mode.

This only occurs on iOS devices. The android device shows a black screen for a second or two.

Cheers,
Ancient Lady
Rich Dersheimer
AGK Developer
13
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 3rd Jun 2012 23:02 Edited at: 3rd Jun 2012 23:04
This won't help your tilting problems, but I'm wondering why you have both setvirtualresolution and setdisplayaspect, I thought it was one or the other, not both, with setdisplayaspect for percentage based coords, and setvirtualresolution for using actual x and y values.

Of course, I could be wrong
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 3rd Jun 2012 23:55 Edited at: 4th Jun 2012 00:03
That was at the suggestion of someone, somewhere, somewhen while trying to get something to work on the android.

I will look at it and see if there is anything strange with it.

Later in my code, I just do the SetVirtualResolution with values taken from a setup file (which happen to be the same) before I actually start putting anything else up in the display.

(Is your icon a real picture of you?)

EDIT: I just removed the SetAspect command, it really isn't needed. No surprise, it has no impact on the orientation issue.

Cheers,
Ancient Lady
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 4th Jun 2012 00:43
This is the right way of doing it:



SetDisplayAspect() is not really necessary in this case.

With the first Sync() you get rid of the white flash, until TGC remove the unnecessary AGKsplash.png. Don't include any AGKsplash.png in your Xcode project.

Directories in LoadImage() are ignored on iOS. Just make sure that you included mysplash.png in Xcode. Make sure the casing of the filename is lowercase mysplash.png just as you typed it in the code.
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 4th Jun 2012 00:45
By the way all the above works 100% in T2, no idea about T1 and bytecode
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Jun 2012 01:11
Well, the first sync() does not get rid of the flash and I do not include AGKSplash.png (as was mentioned in the original post). Every time I test my apps, I completely uninstall them on the target devices before cleaning, compiling and running.

SetResolutionMode has no impact on orientation, it is related to the resolution only.

Directories are not ignored in iOS, especially as of v107x where all the non-windows interpreters enforce a media directory.

I tried my code with all variants (also mentioned): "mysplash.png","/media/mysplash.png" and "media/mysplash.png"

Oh, and my file really is named "mysplash.png". And I definitely include in my Xcode project, checked and double-checked. And, since I am an old style programmer, all the cases are correct. I use nothing but lower case in any file names, as a basic rule.

Yup, it is an interpreter issue for Tier1. I've worked with one of the TGC developers in another thread to get the Android to work correctly with odd ball devices that report as tablet, but behave as phone (like the one I have). We had wonderful fun with orientation issues. But we got it working and it should show up in the next release.

If I could code once, publish many in Tier2, I would. I hope to convert my app to Tier2 after I publish it and then I'll have a good base for all the platforms I work with (Windows, Mac, iOS and Android).

Cheers,
Ancient Lady
Rich Dersheimer
AGK Developer
13
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 4th Jun 2012 01:33
Yep, that's a real pic of me, sort of posterized in photoshop.

I sure will be glad when TGC gets rid of that white flash.
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Jun 2012 02:14
I will be very happy when they get rid of it. The keep saying that the AGKSplash.png is deprecated, but haven't updated the code.

Your picture makes me think of Tom Clancy. You look so ready to take on the world.

Cheers,
Ancient Lady
Impetus73
11
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 4th Jun 2012 20:55 Edited at: 4th Jun 2012 21:48
Ancient Lady, this is how I make my own splash, and it works on android,windows,iOS:



And here is a link to a picture of me and my li'll family in RL to put a face to a nic

http://www.minportal.net/pictures/imp.jpg

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 4th Jun 2012 21:17
Impetus you have too many girls.
Impetus73
11
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 4th Jun 2012 21:20
I do? I thought 10 was the limit... hmm... The one in the middle, is my GF, and the two blondes my stepdaughters. The one in the black dress does not live with us, as she has her own BF.

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 4th Jun 2012 21:21
In T2, putting those commands in that order got rid of the white flash. no idea about T1.

In T2 you can put any directory name before the actual PNG filename and it's ignore by AppGameKit on iOS.

spl_img = LoadImage("hello/mysplash.png")
spl_img = LoadImage("mydir/mysplash.png")
spl_img = LoadImage("mysplash.png")

Are all treated identical. As long as you have mysplash.png in Xcode, all work. Again, this is in T2.
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Jun 2012 22:33
Impetus, these are the first executable lines in my main.agc:


They work fine in Windows and Android. The Mac loads too fast to tell.

I do get a white flash in Windows and a black one in Android. But both show mysplash.png.

In my iOS platforms, all the other images/sprites show up as they should. All my image/sound files are in media and they are all listed and included in my Xcode project.

I even tried adding mysplash.png to the project above the media directory and removing "/media/" from the load command. Still no joy.

The print statement does not show up, either.

I also tried your function call method. Worked fine in Windows (need to go to my other machine to test Android, later), but still no joy.

I am about to try putting back the 1074 environment and testing again. Shudder.....

Cheers,
Ancient Lady
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Jun 2012 22:57 Edited at: 4th Jun 2012 23:49
I just reset my setup back to 1074, cleaned and rebuilt everything.

Two out of three problems cleared up.

My splash screen now shows up after the white flash. The white flash won't go away until they update the core bits to stop looking for the AGKSplash.png file.

And the orientation no longer flips when it shouldn't.

Sadly, the exit delay is worse. In fact, after several minutes, the game still hasn't relinquished the display back to the app menu. I'll have to assume that I am doing something that is causing this problem.

Worse, I won't be able to publish any free w/ad apps that are landscape oriented until at least v1076.

EDIT: I posted the orientation and custom splash issue on the google list.

Cheers,
Ancient Lady
Impetus73
11
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 5th Jun 2012 00:03
I skipped the 1075, hope 1076 will clear things up, so I can get going.

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 5th Jun 2012 00:28
In 1074 the orientation works because 1074 still uses the fake landscape mode.

Native orientation was introduced in 1075.

i am sure that 1076 will fix most of these problems, including the AGKsplash.png which I had begged to be removed since day 1!
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Jun 2012 01:13
I am well aware of the change in 1075 to use the native bits.

Paul (an AppGameKit developer) and I worked together to tweak the android file for dealing with odd ball android devices like mine.

The bits he came up with (and I tested) will appear in 1076.

Now I need to get someone's attention for the unstable orientation in iOS.

Cheers,
Ancient Lady
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 7th Jun 2012 18:16
I solved the orientation issue by editing the 'shouldAutorotateToInterfaceOrientation' function in Classes/UntitledViewController.m to return YES only for the orientation I want.

The white flash is now gone in v1076. So it looks like it is not waiting if it doesn't find the file.

But my custom flash screen still does not display.

And it still takes 25-30 seconds for the exited app to relinquish the display and go back to the main iOS app menu.

Cheers,
Ancient Lady
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 8th Jun 2012 21:23
Forget the Exit on ios. Don't put an exit button, it's not ios style and apple might even not like it!
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 8th Jun 2012 21:32
That's my plan.

Now I have to rework my menu code so that it isn't an option on iOS devices.

Cheers,
Ancient Lady
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 11th Jun 2012 18:25
Ancient Lady does the white flash appear on Windows in 1076, as I can't seem to get rid of it.
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 11th Jun 2012 20:34
I still get a brief white flash, now followed by a brief black flash in Windows, followed by my splash.

I don't recall seeing the black splash prior to 1076 and using the double sync() after loading my flash page.

No flashes at all on the Mac.

Brief black flash after default on iOS.

Cheers,
Ancient Lady
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 9th Jul 2012 19:44
I am using a 960x640 default@2x.png and 480x320 default.png. this works perfectly on iphone but is blown out of proportion for ipad.

is there a solution for this?
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 9th Jul 2012 20:12
Not really. The iPad and iPod/iPhone have different display ratios (width/height).

Your images are designed for the iPod/iPhone ratio.

I have the same problem. I designed my default images so that the cut off right side isn't losing any good graphics.

Cheers,
Ancient Lady
AGK Community Tester
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 9th Jul 2012 21:46
solved the problem.

i put a 1024x768 Default-Portrait.png and the ipad picked that up! It now shows very nicely.
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 9th Jul 2012 22:03
Good to know!

I now know what I need to do for that build.

Cheers,
Ancient Lady
AGK Community Tester
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 9th Jul 2012 22:09
Just so that you know there is also a Default-Landscape.png for the ipad so you might want to keep that in mind too
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 10th Jul 2012 01:15
I am quite aware, but thank you for letting me know (just in case I didn't).

Cheers,
Ancient Lady
AGK Community Tester
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 15th Jul 2012 13:49
PLEASE LET'S GET RID of the BLACK screen between the initial Default.PNG is displayed and app::Begin()

All works fine on iOS T2 1074. There is no white flash and no black screen.

On 1076 there is a long black screen pause. This is really ugly and unacceptable. No other decent iOS app has such a black screen.

Please FIX this as I am stuck with 1074. If the problem is AgkSplash, just remove it once and for all.

I would like to report this in the BUG board if anyone can direct me to an existent report, as I don't want to create a double bug report.

Login to post a reply

Server time is: 2022-10-04 14:50:25
Your offset time is: 2022-10-04 14:50:25