TouchGame Tutorial
by Bryan Duke · in iTorque 2D · 10/13/2008 (6:52 pm) · 9 replies
Not to take the reigns away from anyone at GG, but how about we start threads for the tutorials in iTGB? Lets call this one the TouchGame Tutorial thread.
Just running through the tutorial, here's what I've had to do so far in addition to the text:
It looks like iTGB starts a new project in whatever the resolution of your last project was. For me, my last project resolution wasn't 480x320, so I had to set that in the Edit/Camera settings.
I didn't follow the tutorial exactly on my first time through & missed the "Create Folder References for any added folders" radio button in the Compiling to Similator section...note to self: don't miss that. With that incorrect, I got a white screen on the simulator & an error pop-up on my iPhone.
With a few added steps, I got the tutorial running on my iPhone. If you haven't gone through the provisioning (pain) of Xcode & the iPhone SDK, I recommend going through the process of getting a bare-bones Xcode app to run on your phone first. The Apple tutorials for this in the Program Portal work well - I'm not kidding about "pain" though if you haven't been through this.
Just running through the tutorial, here's what I've had to do so far in addition to the text:
It looks like iTGB starts a new project in whatever the resolution of your last project was. For me, my last project resolution wasn't 480x320, so I had to set that in the Edit/Camera settings.
I didn't follow the tutorial exactly on my first time through & missed the "Create Folder References for any added folders" radio button in the Compiling to Similator section...note to self: don't miss that. With that incorrect, I got a white screen on the simulator & an error pop-up on my iPhone.
With a few added steps, I got the tutorial running on my iPhone. If you haven't gone through the provisioning (pain) of Xcode & the iPhone SDK, I recommend going through the process of getting a bare-bones Xcode app to run on your phone first. The Apple tutorials for this in the Program Portal work well - I'm not kidding about "pain" though if you haven't been through this.
About the author
#2
10/13/2008 (8:43 pm)
Btw....take the reigns for as long as you want! I can use all the help that is offered
#3
I noticed the screen resolution issue as well. On first launch it set the res to 800x600, so I manually set it to 320x480.
Some of this may be OT, but most of it pertains to the Touch Tutorial in some way.
One area that is a little fuzzy for me is screen orientation / resolution settings. With the design resolution at 320x480 (for a portrait game), and Portrait selected in iPhone Options, the camera is still 4:3 (default 100x75). Setting the camera to 320x480 gives a pixel perfect version of the game in both the builder and the TGB game simulator.
BUT - I'm not sure if this is the right way to do this, because once I get it into XCode, following the Simulator Test tutorial it displays the game in landscape mode - but with my image squished to one side. (My "game" is simply a still image without any behaviors or code.)
I also get an "Error: Failed to initialize driver." before the "game" is displayed. I made sure to hit the "Create Folder References for any added folders" radio button, so I probably made a goof somewhere else, but I thought I'd post it anyway in case anyone else has the same issue (maybe related to the screen orientation issue? I don't know). The error and squish are happening in both landscape and portrait modes, regardless of TGB camera resolution settings.
Also, the orientation setting (Portrait/Landscape) in iPhone Options is duplicating itself. Every time I go into options the tab gets longer, alternating Landscape and Portrait options (I currently have 9 landscapes and 9 portraits in my list of choices :)
Thanks again for the awesome docs. I'll post back if I find out why the error message is happening.
10/13/2008 (10:17 pm)
First, huge kudos on the docs. It all seems so simple now :) The screenshots are fantastic. I noticed the screen resolution issue as well. On first launch it set the res to 800x600, so I manually set it to 320x480.
Some of this may be OT, but most of it pertains to the Touch Tutorial in some way.
One area that is a little fuzzy for me is screen orientation / resolution settings. With the design resolution at 320x480 (for a portrait game), and Portrait selected in iPhone Options, the camera is still 4:3 (default 100x75). Setting the camera to 320x480 gives a pixel perfect version of the game in both the builder and the TGB game simulator.
BUT - I'm not sure if this is the right way to do this, because once I get it into XCode, following the Simulator Test tutorial it displays the game in landscape mode - but with my image squished to one side. (My "game" is simply a still image without any behaviors or code.)
I also get an "Error: Failed to initialize driver." before the "game" is displayed. I made sure to hit the "Create Folder References for any added folders" radio button, so I probably made a goof somewhere else, but I thought I'd post it anyway in case anyone else has the same issue (maybe related to the screen orientation issue? I don't know). The error and squish are happening in both landscape and portrait modes, regardless of TGB camera resolution settings.
Also, the orientation setting (Portrait/Landscape) in iPhone Options is duplicating itself. Every time I go into options the tab gets longer, alternating Landscape and Portrait options (I currently have 9 landscapes and 9 portraits in my list of choices :)
Thanks again for the awesome docs. I'll post back if I find out why the error message is happening.
#4
@Michael - Docs rock!
10/13/2008 (10:28 pm)
@Patrick I got that error message when my "Active SDK" was set to 2.1 and my "Active Executable" was set to 2.0 in Xcode. It went away when I cleaned & recompiled with everything double checked as 2.1.@Michael - Docs rock!
#5
For the landscape mode: check the xml in the common folder. perhaps you still have it enforced there (don't know if the iTGB editor changes that as well or only the prefs)
10/14/2008 (6:18 am)
In the simulator there is no OpenAL support so as long as you don't disable sound, the failed to initialize driver error will always happen.For the landscape mode: check the xml in the common folder. perhaps you still have it enforced there (don't know if the iTGB editor changes that as well or only the prefs)
#6
@Marc- Haven't tried it with sound yet, so this time it was definitely my Active and Executable settings. Will look at setting the orientation in XML like you suggest. On the sound issue, are you saying that OpenAL audio works on the device, just not in the simulator?
Thanks for your help guys.
10/14/2008 (6:30 am)
@Brian - Thanks, that fixed the error message.@Marc- Haven't tried it with sound yet, so this time it was definitely my Active and Executable settings. Will look at setting the orientation in XML like you suggest. On the sound issue, are you saying that OpenAL audio works on the device, just not in the simulator?
Thanks for your help guys.
#7
10/14/2008 (6:40 am)
Right, openal is strictly device as is accelerometer control
#8
Also, your method of setting the orientation through the XML file fixed the image offset (what I initially thought was a "squish" was really just an offset).
@GG - I noticed that after restarting iTGB, my Portrait/Landscape orientation options list is now back to just 2 options. It looks like it duplicates the options every time you hit the Play button, then dumps them upon quitting iTGB.
10/14/2008 (7:27 am)
@Marc - Cool, thanks again.Also, your method of setting the orientation through the XML file fixed the image offset (what I initially thought was a "squish" was really just an offset).
@GG - I noticed that after restarting iTGB, my Portrait/Landscape orientation options list is now back to just 2 options. It looks like it duplicates the options every time you hit the Play button, then dumps them upon quitting iTGB.
#9
A fresh download and unzipping of iTGB, on a machine that does not already have TGB or iTGB, should result in a flawless run with proper resolutions and what not.
@Patrick - Nice catch on the GUI. Looks like that list isn't getting reset >_< That would be my error. I'll pass the fix along, and also post the proper files on TDN.
What else....looks like the driver and openAL issue was addressed. Just as Marc said, audio and accelerometer capabilities are device only.
Any fixes that go into the tutorials will be made to the TDN versions first, then rolled new versions of iTGB as they are released.
10/14/2008 (9:28 am)
The xml and default prefs files were all modified with iTGB 1.0.1. Unfortunately, if you have previous TGB or iTGB installations, you have to clear out existing files in the hidden OS folders. I ran into the same problem when testing new builds from the devs.A fresh download and unzipping of iTGB, on a machine that does not already have TGB or iTGB, should result in a flawless run with proper resolutions and what not.
@Patrick - Nice catch on the GUI. Looks like that list isn't getting reset >_< That would be my error. I'll pass the fix along, and also post the proper files on TDN.
What else....looks like the driver and openAL issue was addressed. Just as Marc said, audio and accelerometer capabilities are device only.
Quote:I didn't follow the tutorial exactly on my first time through & missed the "Create Folder References for any added folders" radio buttonYeah...that's a biggie. I had to learn that the hard way during my xCode education.
Any fixes that go into the tutorials will be made to the TDN versions first, then rolled new versions of iTGB as they are released.
Employee Michael Perry
GarageGames
I'm curious about the project resolution issue you faced. When you create a new project, it should default to 480x320. I'm going to look into this more. I'm actually cooking dinner right now, which means I only have about 20 more seconds before I have to get back to the stove. I'll be back here again later and tomorrow to work out the details with you.
Thanks for posting! =)