iPhone Game Programming Tutorial Part 3 – Splash Screen

  • Twitter
  • Facebook
  • Digg
  • Reddit
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
March 18th, 2009 Posted by: (ELC) - posted under:Tutorials

Ok, So it’s time to wrap up this series.  Today I will be showing you how to add a few “bells and whistles” that will make your game more complete.  Let’s start by adding a splash screen to your game (Again I truly apologize for the lack of graphics skillz. Photoshop and I are not friends).

Creating a Splash Page

We will be adding a splash page that will fade out into our main game screen.  Start by downloading this image and adding it to your project’s Resources Folder. Make sure you check the box to copy this image to the project’s directory.

splash

Now we need to add a View Controller to our project that will handle the Splash View.  Go ahead and add a new file to your project that is a UIViewController subclass. Name this file SplashViewController. Make sure you check to create the .h file as well.

screenshot_01
Next, we need to change our AppDelegate to load this view controller instead of our main view controller.  Open up iTennisAppDelegate.h and change it to look like this:
screenshot_02
We are basically replacing iTennisViewController with SplashViewController.  Next, open up iTennisAppDelegate.m and change it to look like this:
screenshot_03
Again, all we are really doing is changeing iTennisViewController with SplashViewController.  This is because we want to load the splash page initially and not the main game screen.  One main difference to note here is we are allocating a new instance of the SplashViewController. We didn’t have to do that with the iTennisViewController because it was being loaded from a nib and our application initialized it for us.  Since we are building SplashViewController programatically (without a nib), we need to instantiate it.  Next, let’s implement the Splash View.  Open up SplashViewController.h and add the following code:
screenshot_04
Let me explain what’s going on here.  First, we see an NSTimer.  This will be used to display the splash page for a certain amount of time before fading to our main game screen.  Next, there is a UIImageView.  This will simply be the imageview of our splash image.
Finally, we see the iTennisViewController.  This is the view controller that we replaced inside of our application’s delegate.  We will be loading it from our splash view. Now, open up SplashViewController.m and add the following code:
screenshot_05
This is just synthesizing all of our properties.  Now, add the following code to our loadView method:
screenshot_07
Lot’s of new code here.  First off, since we are loading this view programatically without a nib, we have to create the view.  So we get the frame that the application is running in and use it to allocate a new view.  Then we set the view of the SplashViewController to this newly created view.  We have to create the frame to basically tell the application to create a view that is 320×480.
The next thing we do is create the splashImageView from the Splash.png image.  We also need to create a frame for this images.  Think of a frame as an empty container that we will put our image in.  Next we add the imageview to our main view.  This will display it immediately.
Next, we initialize our view main controller by passing it the nib it will load from.  Next, the view’s alpha transparency is set to 0.0.  This makes it completely invisible.  Finally, we add it to our view.  Note that it is on top of the splashimageview but is not visible because the alpha transparency is set to 0.0.
Finally, we start the timer.  This will show the splash screen for 2 seconds before calling the “fadeScreen” method.  Let’s implement the fadescreen method.  I must note that I took the fadescreen method from this post.
Add the following code:
screenshot_08
Lots of animation stuff.  Pretty well commented so I wont go into it too much.  Basically, we fade the view out in fadeScreen, then it calls finishedFading when its done.  Finished fading fades the view back in as well as fades viewController’s view back in.  It will now display our main view.  Make sure you remove the splash from the superview or you will get a weird transition.
That’s it for the splash page.  You can Build and Go to see the view transition from a splash to the main game.

That’s all for today.  Join me next time when I will show you how to add audio to your game. If you have any questions or comments, feel free to leave them in the comments section or write me on Twitter.

You can download the source for this tutorial here

Happy iCoding!

  • http://trumandesigns.com christopher truman

    WOW! Fantastic tutorial! I especially enjoyed learning to add a splash page which is a nice touch for any game.

    Will you be uploading the source for download?

  • andy1492

    hy, i’m new in programming with the iphone sdk and i LOVE your 3 tutorials …

    its perfect for beginning, also if you didn’t develop with objective-c

    thx :)

  • Tim Daley

    Yet another great tutorial thank you!

  • sourcecode

    where is the source code?

  • Kevin

    thank you very much this is very helpful.

  • John

    Hey, this is great, thank you. When is the next tutorial going to be uploaded as i only have until end of march to complete my own project and i want to incorporate audio in mine.

  • http://radiancedeveloper.wordpress.com/2009/03/19/creating-a-splash-screen/ Creating a Splash Screen « Playing with Radiance

    [...] iCodeBlog » Blog Archive » iPhone Game Programming Tutorial Part 3 – Splash Screen. [...]

  • Will

    Anyone know how to move the paddle on the x and y axis?

  • Will

    The source is below the ads

  • Nasser

    Wow, didn’t know it is that simple.

    typo report:
    it is not a typo actually but the IBOutlet of SplashViewContrller *view controller in property declaration is not required since it is created with code.

  • Nasser

    sorry i forgot to thank you so thank you very very much
    i have learned a lot from you Brandon.
    thank you again

    feel free to delete both posts.

  • Alex

    Thanks for another great tutorial.

    Anyone know how to improve the collision detection?

  • http://www.lotofwallpapers.com Chintan

    @Alex…

    For improved collision detection, you will have to use Cocos2d framework for iphone games. You can have pixel level collision detection by using cocos2d.

  • John

    Hey, how do you add a main menu screen after the splash screen. The main menu will enable you to select the button start new game??

  • http://brandontreb.com Brandon

    @John,

    From this tutorial, that should be pretty straight forward. Just transition this to a menu view. Then, in your menu view, load your main view when a new game button gets tapped.

  • http://www.onemoretap.com XCool

    Great tutorial! Clean, simple and useful. Exactly what I’ve been looking for… ;)

  • http://none dude

    thanks for answering my questions ass face

  • http://brandontreb.com Brandon

    @dude ??, what was your question and why are you so mad at the world?

  • alan

    Thanks for the tutorial, very helpful. After the animation ends, its supposed to transition back to the xxViewController.xib, however mine just shows up as a blank view, even though I’ve made changes to the xxViewController.xib through interface builder. I’m sure its something simple and an error on my part, but any ideas?

  • http://afruj.wordpress.com/2009/03/24/iphone-tutorials/ iPhone development Tutorials « The Brook Song – ঝর্ণার গান

    [...] 37. Game tutorial-3 [...]

  • yiannis

    Thank you for a great tutorial!

  • John

    I am stuck on how to make the menu menu screen (where you can select start game) appear after the splash screen?? How do i do this

  • Jtdreisb

    This was exactly what I needed to give me a jump start into writing my own code thanks alot.

  • Christopher

    Curious if you could make a video of what this is supposed to look like after its done.

    I have a feeling what im seeing on my screen isnt what should be happening.

    =\

  • Grant

    This is a great tutorial for people like me who know very little about programming. Thanks.
    I have a question. I sometimes get the error ‘context’ undeclared (first use in this function). I was wondering what to do about that.

  • Alex

    Hey, nice tutorial, buuut…
    i gues splash screens suck. In your example you’re stealing bout 5 seconds of the users valuable time with just some boring animations. is that really necessary?

    for an on-the-go experience the should provid its valuable content as fast as possible wothout keeping the user waiting…

    my 2 cents.

    Alex

  • http://joris.kluivers.nl jbwk

    I agree with Alex. The only acceptable reason to display a splash screen is when you are loading game resources. In this example code you are only boring the user with an unnecessary delay.

    As Apple writes in the user interface guidelines: Avoid splash screens whenever possible.

  • joelrb

    Hi! Thanks for a great tutorial.

    I have this code in my previous project for animating two views (fade in/out). I tried this in your code and it works also:

    - (void)fadeView
    {
    CGContextRef context = UIGraphicsGetCurrentContext();
    [UIView beginAnimations:nil context:context];
    [UIView setAnimationDuration:0.75];

    if ([viewController.view superview]) {

    [self.view bringSubviewToFront:splashImageView];
    [splashImageView setAlpha:1.0];
    }

    [splashImageView setAlpha:0.0f];
    viewController.view.alpha = 1.0;
    [splashImageView removeFromSuperview];

    [UIView commitAnimations];
    }

  • John

    Hey, can someone help me to create a main menu screen. Also, when is the next tutorial coming out?

  • Kris

    This is a great tutorial. Thanks for the information.

    I’m stuck on changing the background color so that the splash image fades to black. Currently, as you are likely aware, it fades to white. I’ve tried setting the background color through various channels with no luck.

    Any help with this would be greatly appreciated.

    Thanks,
    Kris

  • kyle

    would it be at all possible to increase the speed of the ball as gameplay goes on?

  • John

    When is the next tutorial going to be published?

  • Tulius

    Hi!

    Do you think you could make a splash screen tutorial for a Tab Bar View instead of a regular view?

    I am trying to make it work, but I keep getting an exception with this message: “this class is not key value coding-compliant for the key tabbarController”.

    Thanks in advance!

  • http://cimota.com/blog mj

    I think the point being made is that maybe you don’t need a splash screen for THIS GAME but you might and it’s all part of the tutorial. Apple uses them ALL THE TIME, even in MobileMail.

    Wanna bet how many iTennis games hit the store this week?

  • Rome

    From Part 2, when a point is scored and tapToBegin appears and the ball is centered, it actually puts it below the “net”, closer towards the yellow racquet. I think this is because of the display bar on the top. Any ideas how to actually center the ball even with the display bar displayed? Thanks

  • Rome

    Hmm, disregard my previous post. It seems to be centering now, yet I don’t think I changed anything…

    Thanks for pt. 3 of the tutorial though! This really helps a lot.

  • http://www.iphonefootprint.com/2009/04/iphone-game-development-guide-on-the-go-tutorial/ iPhone game development guide: On the go tutorial | iPhone Footprint

    [...] The second part talks about user interaction, Simple game AI, game logic etc.The third and the final part contains integration of the [...]

  • John

    Hi, when is the next post going to come out?

  • Lame-o

    Brandon,

    Righteous tutorial!

    Dude,

    You are an asshole!

    John,

    Learn something on your own!

  • John

    I really need help to create a main menu screen. Can someone help?

  • TCL987

    Awesome tutorial.

  • coder4real

    Any one have ideas on doing this when your Game is an Opengl ES view? I have a simple game that does all the drawing in opengl ES. I created this based of the Opengl ES template provided. I tried commenting out all of the openGL code from the delegate and unconnecting the “openGL view” connection in the interface builder but the drawView() method is still getting called when the app is initialized. I’m not even instantiating an instance of this view so there must be something that the template set up that I don’t know about. Any ideas on how I can stop the drawView method from being called by default so I can call it myself after the splash screen has finished?

    Thanks!

  • iNewbie

    Hi guys,

    I am so glad to see such a great example of a basic iPhone game. I followed the tutorial carefully, but what I got is a working splash screen followed by a empty court that doesn’t respond to clicks in the simulator. I had a friend tried my code but ended up with exactly the same thing.

    What I have missed?

    Thanks!

  • http://xnanoob.exteen.com xnanoob

    this is nice tutorial

  • Aben10

    Great tutorial!!!!! Thanks. my ball is still gettiing trapped on the racquet. Can u or anyone help find the problem?, i have the new code u posted but still getting trapped. thanks for the help and keep up the great work.

  • Ken

    I have a question in loadView about the allocs for the splash view and the iTennisViewController. In both cases, there was no release. Is it not needed in these cases? Who does the releasing?

  • James Revolti

    Congratulations!
    This tutorial is very usefull!

    Thanks!!

  • chris

    The ball is still getting stuck will you update the tutorial please!!!

  • http://diamondtearz.org/blog/2009/04/28/links-for-2009-04-28/ links for 2009-04-28 | diamondTearz

    [...] iCodeBlog » Blog Archive » iPhone Game Programming Tutorial Part 3 – Splash Screen (tags: iphone splashscreen) [...]

  • http://lookapp.ru/2009/05/19/iphone-sdk-tutorials16/ Уроки iPhone SDK: (Часть 3) Программирование игр на iPhone. “Пишем” игру iTennis. Экранная

    [...] Текст оригинальной статьи на английском языке [здесь] [...]

  • http://itpblog.efuller.net/?p=881 iCensr [navigation layout part 1] | Uploading

    [...] following iCodeBlog’s splash screen tutorial, I threw together a placeholder splash screen, the first draft of the sign in page, and [...]

  • http://none holografix

    Amazing tutorial mate, covers basics mechanics of a game AND basic cocoa touch mechanics!

    One teeny little question…

    Why do you set the Alpha of the splash screen back to 1.0 in the finishedFading method?

  • http://vinc456.wikidot.com/cocos2d Myspace: Cocos2d-iPhone

    [...] Cocos2d-iPhone Collection of various links Homepage Google group API reference Notes on Cocos2d iPhone Development Move sprite example Introduction to Cocos2d iPhone Monocles Studio Intro Collision particle Great site with lots of simple examples Game walkthrough Sapus Tongue Sources Coloring Sprites Bounching ball 2 Permadi Splash screen [...]

  • http://brandontreb.com/part-3-of-iphone-game-programming-tutorial-posted-on-icodeblog/ Part 3 of iPhone Game Programming Tutorial Posted On iCodeBlog | brandonTreb.com

    [...] = ‘brandontreb’; It’s been a while, but I finally posted part 3 of the iPhone Game Programming tutorial series on iCodeblog.com.  The focus of this tutorial was to create a splash page for your game [...]

  • Abu Bashar

    This is really very good tutorial to learn the gaming consept and start doing development. also iCodeblog have rich tutorials for the beginners and advance iphone developers.

    Many Thanks

  • O.

    Hi, thanks for that great tutorial!

    In loadView, shouldn’t
    -> “splashView.frame = CGRectMake(0,0,320,240);”
    be
    -> “splashView.frame = CGRectMake(0,0,320,480);” ?

    Also, I guess tat instead of hardcoding the values in it would be possible to use the appFrame Rect values isn’t it?

    Thanks!

    O.

  • http://pixeledstudios.com p0stal

    Here’s a much easier way to create a splash screen (1 line of code!)

    Name your splash screen image “Default.png” put it in your resources folder then simply add the line “sleep(3)” in your [name]appdelegate.m under

    - (void)applicationDidFinishLaunching:(UIApplication *)application {

    ie:
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    sleep(3) /* 3 is the number of seconds you want it to last for */
    }

  • adam

    Hey why can’t i see his video for quickly using the interface buidler in part 1 of your tutorial

  • http://web-geeks.com Techy

    These are great tutorials! I was going to go farther in depth to them by figuring out the code lol, but ever since the website move a lot of the images in the newer tutorials are gone, so you might want to upload them again..

    Thank You for all the time and work you put into all these tutorials to help newbies like me =D

    Techy

  • http://www.bubidevs.net/2009/04/17/devtutorial-15-creiamo-il-nostro-primo-gioco-pong-parte-iii/ DevTutorial #15 – Creiamo il nostro primo gioco, Pong! (Parte III) – Bubi Devs

    [...] “Bubi Devs”. La versione originale inglese del tutorial è disponibile a questo indirizzo: “iPhone Game Programming Tutorial, Part 2 – iCodBlog“. I meriti quindi relativamente alla versione inglese, sono del legittimo [...]

  • kyle

    Thanks for putting the time into these great tutorials!

  • http://blog.spicyiphone.com/iphone-game-programming-tutorial-part-4-basic-game-audio Spicy iPhone » Blog Archive » iPhone Game Programming Tutorial Part 4 – Basic Game Audio

    [...] a time.  Ok, let’s get started… Make sure you are starting with the base code from the previous tutorial (either use yours or download a fresh copy).  We will be using 2 sounds today, 1 for when the ball [...]

  • http://eiphonestudy.com/2009-09/iphone-game-programming-tutorial-part-4-%e2%80%93-basic-game-audio.html iPhone Game Programming Tutorial Part 4 – Basic Game Audio | Iphone Study Blog

    [...] a time.  Ok, let’s get started… Make sure you are starting with the base code from the previous tutorial (either use yours or download a fresh copy).  We will be using 2 sounds today, 1 for when the ball [...]

  • http://www.linkedin.com/pub/zyrtec-get-online-legally/16/403/b75 ezpudmepbnbb

    tnndxqocdcku

  • http://www.irelandgoal.ru/ Дмитрий Шеметов

    По правде говоря, сначала не очень то до конца понял, но перечитав второй раз дошло – спасибо!

  • http://www.holland13.ru/ Сергей Леликов

    respect

  • http://www.hungarygoal.ru/ Павел Хохолин

    Спасибо! Пригодится…..

  • http://musicxsat.ru/ Лаврентий Андреев

    Занятно пишете, жизненно. Все-таки, для того, чтобы делать по-настоящему интересный блог, нужно не только сообщать о чем-то, но и делать это в интересной форме:)

  • http://www.allstrategy.ru Мечислав Шумилов

    Чем-то это отдает напеванием свирели в предновогоднюю ночь, чем то похоже на праздникк, чем-то на казино… Ну сами продолжите дальше

  • http://link Mr.Carrot42

    The court should try to determine beforehand, as best it can, if the victim is subject to battered women’s syndrome. ,

  • http://iphonegeek.zuesitech.com/%e7%bc%96%e7%a8%8b/165 iPhoneGeek 爱疯极客

    [...] Mar 2009 原文见:iPhone Game Programming Tutorial Part 3 – Splash Screen   æ¸¸æˆ, 编程   ç¼–程, 教程, 游戏 [...]

  • deepp

    Hi Brandon,i tried using this

    - (void)loadView
    {
    // Init the view
    CGRect appFrame = [[UIScreen mainScreen] applicationFrame];
    UIView *view = [[UIView alloc] initWithFrame:appFrame];
    view.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
    self.view = view;
    [view release];

    logoImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo.jpg"]];
    logoImageView.frame = CGRectMake(0, 0, 320, 480);
    [self.view addSubview:logoImageView];

    splashImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"splash.jpg"]];
    splashImageView.frame = CGRectMake(0, 0, 320, 480);
    [self.view addSubview:splashImageView];

    ballImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"menu.jpg"]];
    ballImageView.frame = CGRectMake(0, 0, 320, 480);
    [self.view addSubview:ballImageView];

    viewController = [[Nine_WarriorsViewController alloc] initWithNibName:nil bundle:[NSBundle mainBundle]];
    viewController.view.alpha = 0.0;
    [self.view addSubview:viewController.view];

    splashCounter =0;

    timer = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(fadeScreen) userInfo:nil repeats:YES];
    }

    as i am trying to show logo ,splash and then menu page but this is working fine but i am trying to do following in

    - (void) finishedFading
    {
    splashCounter++;
    [UIView beginAnimations:nil context:nil]; // begins animation block
    [UIView setAnimationDuration:0.75]; // sets animation duration
    self.view.alpha = 1.0; // fades the view to 1.0 alpha over 0.75 seconds
    viewController.view.alpha = 1.0;
    [UIView commitAnimations]; // commits the animation block. This Block is done.

    if(splashCounter == 1)
    {
    [logoImageView removeFromSuperview];

    }
    else if(splashCounter == 2)
    {
    [splashImageView removeFromSuperview];

    }
    else if(splashCounter == 3)
    {
    [ballImageView removeFromSuperview];
    [timer invalidate];

    }

    //[timer setFireDate:[NSDate dateWithTimeIntervalSinceNow:1]];
    //timer1 = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(fadeScreen) userInfo:nil repeats:NO];
    }

    but the above method is not working properly as its suppose to delete logo image then splash and then should show menu image

    but it keeps showing menu image all the times with fading effect…..where am i doing wrong??? please help

  • deepp

    ohh i got it….its my silly mistake…. i was drawing it other way around….its solved…

  • Tommy Myers

    How do i make the first and second image the same amount of seconds of showing?

  • anonymous

    Mine doesn’t open properly please help

  • anonymous

    for some reason my pics disappear according to alert Help???!!!

  • Phil

    Thank you very, very, very much for taking the time to post these tutorials, they are a great help.

  • Chris

    I’m getting this error:
    iTennisAppDelegate.m:18: error: ‘SplashViewController’ undeclared (first use in this function)

    Help?

  • Chris

    I am not able to get the project to launch in the build and run, as soon as the splash screen launches it crashes, I have gone back over all of the tutorials and everything is correct, I have even downloaded your source code and it does the same thing as well i don’t know if I am doing something wrong but I cannot get the product to launch.

  • http://kompmoder.ru Vladislav2
  • http://alexblundell.com Alex Blundell

    You don’t need to do all this just for a splash screen. You can just post in your Default.png into Xcode, and then in the ApplicationDidFinishLaunching; method, you would put [sleep 5] (to sleep 5 seconds). During this sleep period, Default.png is shown.

    Of course, if you wanted it to fade out, then your method is better, but for a basic splash screen, you only need one line of code.

  • Toni

    How should the source code be if i don’t want a fader to go from the splash screen to the mainscreen? I want to tap the splash screen to go to the mainscreen.

  • http://allsizemusic.ru/ Vladislav22
  • http://oniya-asitaba.com/ Vladislav27
  • http://all4webmaster.ru/ Vladislav35
  • http://rupeople.com/ Vladislav67
  • http://mobile-country.com/ Vladislav73
  • http://dnepr-tracers.com/ Vladislav86
  • http://tautott.ru/ Старый

    В рот мне ноги, глупая новость

  • http://auto-nht.ru/ Uinov

    Автор неутомим

  • http://auto-pre.ru/ PrunZesee

    Не поспоришь, веселая новость

  • http://automoonn.ru/ Стелла

    Честное слово, неуместная заметка

  • http://www.lacucina.livejournal.com/ Valera10
  • http://none Dan0nator

    Make sure and review the use of capital letters. Look at your code and make sure the color of the words match the example. If not there is an error, you might need to retype that section.

  • http://aboxauto.ru/ Кейсария

    Не спорю, получилась статья

  • http://autougs.ru/ Tasuta

    Чего и следовало ожидать, написавший кошерно накропал.

  • http://rhrauto.ru/ Академик

    Черт, плохая статья

  • http://recautoz.ru/ Ремонт вариаторов

    Должен признать, афтар ништяк опубликовал!

  • HENEMAN

    Hello,
    I try to understand this tutorial and there is something i don’t understand…
    When we open the application, we can see a first image which name is “Defaut.png”.
    After, we can see the splash screen.
    But, where is declare this image “Defaut.png” ??

  • http://rbenews.ru/ M Star

    Супер! Спасибо :0

  • Mital Pritmani

    hello,

    Your tutorials are really Best. I was given to build a game in iphone and didn’t even know objective-c but your tutorials proved best guide for me.

    Thank you so much !!! Please keep adding such tutorials, these will help all the people who are new to iphone like me and also to others.

  • AD

    Can you use the same principle for a Game start screen, where when you first run the application it says a variant of “Start game”, “Continue Game”, “Hi-scores”, “Credits”, etc?

    Thanks

  • devilchills

    Very great tutorial, I am very grateful for your hardwork and good intentions. tyvm.

  • http://www.iphoneappacademy.com/7/iphone-game-tutorials/itennis-iphone-game-tutorials/ iTennis – iPhone Game Tutorials – iPhone App Academy

    [...] iTennis iPhone Game Tutorial – Lesson 03 [...]

  • Icke

    Ich kann die Source-Dateien nicht “builden”.
    Fehlermeldung: error: There is no SDK with the name or path ‘iphoneos2.2′
    Sollte das Zeug nicht in soweit abwärtskompatibel sein?
    Wie kann ich das beheben (Es wird mir nicht angezeigt, welche Datei genau für den Ärger verantwortlich ist)?
    Ansonsten: Nettes Tut!

  • Icke

    Sh**! I’d had to write in English!
    So: I’m not able to build the source data. I always get this error: There is no SDK with the name or path ‘iphoneos2.2′
    Does the newest version of XCode not support this code or what?
    How can I fix this because XCode doesn’t tell me in which part of the program the error is located.
    But this is a very good tutorial!
    ———————————————–
    Sorry for my bad English.

  • Aaron Trahan

    The “splash.png” image was not loading but it did not give any error or broken image symbol.

    I figured it out the image was named “splash.png” but the in the code it was called “Splash.png”

    Thank you again for this great Tutorial!
    Aaron

  • http://catsrealtqy.ru/ Миша

    Уважаемый зачет

  • http://woodrealjty.ru/ bcnrrhsw

    Думаю, бессмысленная заметка

  • http://marveloper.com/links-for-2009-04-28/ links for 2009-04-28

    [...] iCodeBlog » Blog Archive » iPhone Game Programming Tutorial Part 3 – Splash Screen (tags: iphone splashscreen) [...]

  • http://www.tetraworks.com.br Tiago Machado

    Thanks!! Great blog and post!

    I used this sample to my application, but i also include the splash screen as an animation. To iterate a set of images, just use the following code:


    splashImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];

    splashImageView.animationImages = [NSArray arrayWithObjects:
    [UIImage imageNamed:@"iverbo-splash-00.png"],
    [UIImage imageNamed:@"iverbo-splash-01.png"],
    [UIImage imageNamed:@"iverbo-splash-02.png"],
    [UIImage imageNamed:@"iverbo-splash-03.png"], nil];

    splashImageView.animationDuration = 0.75;
    splashImageView.animationRepeatCount = 0;
    [splashImageView startAnimating];

    [self.view addSubview:splashImageView];

  • http://www.tour2kerala.tk kerala tourism

    Thanks its working fine and one Doubt how can add a Peal effect to it

  • http://www.openxcell.com iPhone Application

    I am so glad I found your blog. I always look for informative post to update myself. I like your post. Thanks for sharing information about iPhone game development. I am a mobile application developer. It is a very interesting task for me to develop game application for iPhone.

  • http://labs.dariux.com Dario Gutierrez

    Thanks dude, great tutorial and very well explained! It was very useful to my personal project.

  • Riscar

    I have tried this tutorial bout twice now and when ever I try to play on the Ipod Touch it hangs up on the ITennis loading screen anyway to get past that part? I have even tried copy paste your code into xcode and still have the same problem…

  • Hoang Le

    Very useful tutorial !

    1 questions is :
    Do you create the SplashScreenViewController programatically (not by nib file) because it’s fast and appear on the screen immediately ?

    Thanks

  • Strike

    Thanks for the great tutorial, but actually I’ve some strange thing. I found that the splash screen appears without adding any code for that. all what I did, is that I put the “Default.png” image in the resources folder and I found it appears while running. Is that related to the SDK version that I use….actually, I use iOS SDK 4.2 and Xcode 3.2.5 ….. please answer my question as really I need to know what is the reason for that??

  • Guitar_man_jon

    Default.png is a required file that the iOS automatically displays while loading the app into memory. The splash screen in this tutorial is an actual splash screen, as in an image loaded at the beginning of a program to give the user some information such as version number or support phone numbers, etc.

  • Haz

    great tutorial, but just 1 question: What do you do if when you follow the guide completely, it still has 3 errors, therefore it will not let you build the app and test it?

  • Sean

    i used all the same code u did and when i run my app it runs the Default.png as soon as i open it, but after that it only displays the window view in the mainwindow.xib. I’ve quintuple checked my code and nothing seems to work! what’s the problem?

blog comments powered by Disqus