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 / Some v1076 Tier 2 Templates

Author
Message
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 19th Sep 2012 21:41
I've posted zipped templates elsewhere for iOS, Android and VS10.

Here is the full set updated today so they are all consistent. This posted file is a zip containing three separate template zip files.

They all have the same template.h and template.cpp files that include some of my tweaks for usability.

The template_vs10.zip is a complete Visual Studio 2010 Express project, but you might need to change directory paths within the project since I use short, non-default directories.

The template_ios_xcode4.zip file contains only the code/header files needed to bring your project up to v1076 code status.

When you unzip the iOS template, do so in a directory that does NOT contain your original template_ios_xcode4 directory. Macs wipe out all content when replacing a directory, unlike Windows which just adds/updates content. Then copy the contents of the unzipped directory to your template_ios_xcode4 directory, including the files in the Classes subdir. Those files are the ones with the AppGameKit specific updates.

The template_android.zip file contains: the correct AndroidManifest.xml, .project, .classpath and project.properties files; the jni directory with correct .mk, .h, .c and .cpp; the armeabi and armeabi-v7a directories with the properly compiled AppGameKit android libraries; and the src directory with the TGC helper stuff needed for the compile/run.

If you are doing your Android/cygwin/Eclipse stuff on a Windows based computer, you can simply unzip the template_android.zip file in the <androidpath>/AGK/IDE/templates directory and let it overwrite the existing bits (you might want to copy your old directory and rename it, just to be safe). If you are using a Mac, observe the same precautions as for the iOS template file.

For all platforms, there is an extra function in template.h/.cpp that allows you to exit the program as if you had called the End function in a Tier 1 app. There is no End() function for Tier 2.

For iOS compiles, it includes some bits to catch when your app gets sent to the background. The Classes/Core.m file has the extra 'function' for catching the 'go to background' action (applicationWillResignActive). Yes, it does call the new appGetResumed() function in template.cpp when the app goes into the background. But the function will only execute when you resume the app because the app is sent to the background immediately.

For the iOS template, it also includes a fix in the 'shouldAutorotateToInterfaceOrientation' function in Classes/UntitledViewController.m so that the AppGameKit orientations align properly with the iOS device orientations.

If you are updating existing Tier 2 projects that you were having difficulties with, copy everything from the zip files EXCEPT the template.h and template.cpp (that would overwrite your own app). But go ahead and copy the extra stuff from the files, if you want to use them.

I hope this is helpful.

Cheers,
Ancient Lady
AGK Community Tester

Attachments

Login to view attachments
baxslash
Valued Member
Bronze Codemaster
15
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 19th Sep 2012 22:04
Thanks a lot AL that's a great share. Handy to have it all in one place too


this.mess = abs(sin(times#))
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 19th Sep 2012 22:07
Yup. I was updating a couple of my templates and realized that I'd posted them in a few places and couldn't remember where. So, I figured one post that had a nice easy title and one file was a good idea.

Naturally, I'm willing to bet that someone has problems with something. And I'll fix what I can.

Cheers,
Ancient Lady
AGK Community Tester
xGEKKOx
AGK Master
13
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 19th Sep 2012 22:15
Ok i will give a look and add some of my fix to help all to solve other bugs.

Long life to Steve!
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 19th Sep 2012 22:41
xGEKKOx, if you have good fixes for other bugs, please share and I'll add them to the templates and update the uploaded file.

What bugs have you fixed?

Cheers,
Ancient Lady
AGK Community Tester
bjadams
AGK Backer
14
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 19th Sep 2012 23:30
i updated my templates for ios xcode3, vs2010 and eclipse some time ago, but i forgot what i did!!

it would be great if TGC did the guide they promised to convert the player template into a t2 template so we will be right on track when the next update comes out.
xGEKKOx
AGK Master
13
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 20th Sep 2012 13:13
Sorry if i lose time, but i can't stand sit too much time because of my last surgery ahahah to the leg-butt and i'm looking now at the templates i downloaded.
I'm just opening the files and i will add something and i will explain what i've added.


Long life to Steve!
Hodgey
13
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 20th Sep 2012 13:33
Thanks for sharing Ancient Lady! I'll make good use of your Android one.

xGEKKOx
AGK Master
13
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 20th Sep 2012 14:10 Edited at: 20th Sep 2012 14:33
Edit : i only work on XCODE (iOS/Mac) so i didn't gave a look for android ones.

Ok i just compared the templates with mine...
And i can confirm that 1076 is a good choice only if you need it.
I use the 1074 AGKLIB with my fix for orientation.

If you don't need the 1076 this is my fix for the Landscape Left (you can change as you want):

Add this in the awakeFromNib at the end, and choose your orientation both in AppGameKit (in the 1074 0,0,0,1) and in untitledViewController.m with my piece of code.

Edit 2: For the keyboard fix on orientation, i use the same fix upper, but not in the awakeFromNib but in keyboardwillshow adding a notification that call the function.

I never got the orientation i need in 1076, i don't know why.
As i use Obj C (50% of my codes) for example to use edit boxes mixing the AppGameKit layer with mine, i don't need the last addictions in 1076.

I never got rejected for the orientation cause i use this:

But in the INFO parameters i only allow Landscape (left or right).

If you use this combinations of fix, you can get your orientation fixed to 1 position and Apple will think that you use Portrait and Landscape, so 2 minimum as they require.

We can say that the template, in the end, is personal, because we code it for our specific needle.
But with your the template i can't get it as i want, cause i want it came out directly in Landscape.
Instead with 1076 i get always portrait and then stretched, cause it is coded for landscape only.

Anyway i don't know if the catch for the background is included in 1074, i will do some test.
Usually i don't enable the background feature for my apps.

Long life to Steve!
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 20th Sep 2012 17:54
1076 fixed the basic orientation problems with 1074.

I've posted elsewhere the fixes for one orientation http://forum.thegamecreators.com/?m=forum_view&t=198994&b=44.

But I initially did the same as you to get my orientation working. And then ran into a bit of an issue when I created a test app with 1076 fresh files showing the orientations reported by AGK. It reported the wrong ones for the two landscape orientations.

The core problem was a misunderstanding between AppGameKit and iOS about the landscape orientations. That I fixed in the shouldAutorotateToInterfaceOrientation function, based on the 1076 version of the UntitledViewController.m file.

In addition to my fix to UntitledViewController.m and setting only one landscape option in the xcode project, I added the following following lines to my <project>-Info.plist:


I also execute the following as close to the first as possible:


Between all those bits, my app comes up immediately in the desired landscape orientation. But you would need to make sure to use the same set of files in the Classes directory as I included in my posted template. To repeat, there is a very specific fix for the misunderstanding about landscape orientations between iOS and AGK.

If Apple initially rejects my app because of one orientation, I expect to successfully make the argument that the game can only be played in exactly one orientation because of how it is played.

I have several iOS apps that only play in either landscape or portrait mode, that is not uncommon.

I am not doing any background features, the code I added was so that you could tell when your app had been sent to the background when the user presses the home button and then reopens your app. It does nothing while in the background.

The catch for going to the background is my own code, added to the 1076 bits. You won't find it in any official version of the AppGameKit files. But you are more than welcome to use it.

You should be able to use all the Class files from my xcode4 template in your xcode3 template.

Cheers,
Ancient Lady
AGK Community Tester
xGEKKOx
AGK Master
13
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 20th Sep 2012 18:06 Edited at: 20th Sep 2012 18:11
Thx Lady, i will do some other test with the "forced" agk:: OrientationChanged(3);
I didn't know the existing of this function.

Yes, if i remember Apple require only 2 orientation that can be the same.
For example : LandscapeRight or LandscapeLeft.
In this way we can say that we are happy enough.

So AppGameKit 1076 has a bug inside orientation we can finally say?

Edit : if i can help for some other don't hesitate to ask

Long life to Steve!
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 20th Sep 2012 18:21
Aside from AppGameKit and iOS having different ideas about orientations 3 and 4, there are no issues with orientation in 1076.

The InnerActive ad stuff shows up and clicks in the correct place in landscape and the edit stuff shows up in the correct orientation as well.

I can't think of anything that got broken in 1076, but several things were fixed.

Cheers,
Ancient Lady
AGK Community Tester
xGEKKOx
AGK Master
13
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 20th Sep 2012 18:29
I just tested and.... for me did't worked.
I think i must continue to use 1074 for this purpose.
Maybe i done some old fix that now i don't remember but i always see AppGameKit in portrait stretched to landscape and OBJ c in correct position.

As i see agk don't wanna set the orientation as i expect. Damn!!
I guess if in 1076 there are things i need... hmmmm

Long life to Steve!
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 20th Sep 2012 18:36
Did you replace all the files in <yourproj>/Classes directory with the ones from my uploaded template?

More importantly, did you put the 1076 libraries and headers in the IDE/platform/apple and IDE/common/include directories?

If you want to use 1076, you need to make sure that all of your inputs are 1076 files (headers, code, libraries).

If you do replace libraries, be careful. Don't simply copy the IDE directory. The Mac will delete the entire directory (including your project directories) when replacing it. In Windows, it will only add/replace. In Mac it completely replaces without preserving anything. If you do update to 1076, copy each directory separately (IDE/common, IDE/platform, <proj>/Classes).

Cheers,
Ancient Lady
AGK Community Tester
xGEKKOx
AGK Master
13
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 20th Sep 2012 19:09
I have 2 folders and i change every time the one to get the current AGKLIB.
But i didn't copied all the files from your template.

So i need all files or i can copy only some parts?
Is the UpdatePtr the one that update the orientation?

Can you tell me for orientation which one i can copy leaving the others?
Thx very much for your help.

Long life to Steve!
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 20th Sep 2012 19:39
I would suggest copying all the files in Classes, there are a few fixes in there for 1076 that aren't mine.

If you use the SetOrientationAllowed and OrientationChanged commands as well as the Xcode orientation designations in the project, the files in the Classes directory work just perfectly.

Attached is a complete Xcode 4 project for showing orientations. I know you are using Xcode 3, but all the code files will still work.

The app shows that the orientation displayed is expected as you flip the device.

If you change the commands in the app::Begin member to select only the orientations you want and to set the initial orientation, and set the allowed ones in the Xcode interface (and probably add the lines mentioned a few posts back to the <project>-Info.plist file), you'll see that you can force the orientation any way you want.

I might suggest going to Xcode 4, since that is the current 'preferred' one from Apple. Then, if you want, I'll post the complete template_ios_xcode4 project.

Cheers,
Ancient Lady
AGK Community Tester

Attachments

Login to view attachments
xGEKKOx
AGK Master
13
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 21st Sep 2012 01:37
I use Xcode 4 last version on mountain lion.
I always use the last update for all coding software.

I will try to give a better look to your template... Is very hard to find the differences

Long life to Steve!
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 21st Sep 2012 17:44
Does the agk_orient_t2 project in my last post compile and work properly on your devices?

Attached is a complete Xcode 4 project that supports exactly one orientation and switches to it immediately. The Default.png file is actually the Default-Landscape.png rotated 90 degrees. This is one way to make the initial display appear to be rotated before the code actually executes.

See if it works properly for you.

Cheers,
Ancient Lady
AGK Community Tester

Attachments

Login to view attachments
xGEKKOx
AGK Master
13
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 21st Sep 2012 18:06
LOL Lady, i just updated to ios6 the xcode and the orientation are completely changed!!!!!!!
Ahahahha, we are doing a strange run!!!

Anyway now i try to add all your code to one of my "best-seller" app and try to do an update using the AppGameKit 1076.

i will notice you in some minutes...

Long life to Steve!
xGEKKOx
AGK Master
13
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 21st Sep 2012 18:47
Ok Lady. With your code, i have now all ok in 1076 in iOS6.
I added all the things different from your code to mine.

Now is all ok!!!!

Nice fix Lady!!!

Long life to Steve!
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 21st Sep 2012 21:29
Always glad to help. See my latest post in the AGK->iOS forum for the 'fun' I've had with iOS 6.

Cheers,
Ancient Lady
AGK Community Tester
xGEKKOx
AGK Master
13
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 22nd Sep 2012 13:42
I wanna confirm the fix of Ancient Lady that work also as a FIX for the orientation mixing AppGameKit with OBJ C withour tranforming to 90 degrees all the graphic!!!!
I'm using this in GG Basic.
Usually i needed to transform all the coordinates, but now is all 0,0 in the left-upper corner!!!
Great!

Long life to Steve!
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd Sep 2012 18:10
Thanks xGEKKOx, that is good to know.

I think most of the fix you are seeing is in using the v1076. They did update some stuff in the libraries (I think).

Cheers,
Ancient Lady
AGK Community Tester
CodeTrasher
10
Years of Service
User Offline
Joined: 18th Jul 2012
Location: Tampere, Finland
Posted: 8th Nov 2012 08:10
Thanks, Ancient Lady, for the templates!

I think you've made newer templates on the AppGameKit wiki page, but I downloaded the ones on this board and tried to compile VS2010 template on Professional version. It worked fine on my machine, no issues during compilation. Thank you for the effort of getting these templates together. =)
CodeTrasher
10
Years of Service
User Offline
Joined: 18th Jul 2012
Location: Tampere, Finland
Posted: 8th Nov 2012 09:20
Ancient Lady, I have a question about the VS2010 templates.

I noticed your templates are for VS2010 Express, but I managed to open a template on Professional version and compile it.

What I noticed during running the template app, the agk:rint() method prints text centered in the window. Is this a bug in the template or did this happen only on my Professional version? Do I need to change some settings inside template code or try a newer template? Thanks for any help!

CodeTrasher
Ancient Lady
Valued Member
18
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 8th Nov 2012 15:30
That's not a bug. It's just the way it works for agk:rint when you are using the Percentage system (by default).

The template is making no effort to set anything for the display and the Core.cpp file sets the display to 640x480.

Cheers,
Ancient Lady
AGK Community Tester

Login to post a reply

Server time is: 2022-12-04 02:31:45
Your offset time is: 2022-12-04 02:31:45