Hi,
I read a lot of answers in the forum about how to change the coco2d splash screen when the application runs in an iOS mobile.I tried everything, but I can not make it work.
Anyone can help me? When the application runs, the coco2d logo appears. I need to change that logo for another. Need I add code in AppDelegate or can I find the image.png that appears and replace it with another… ?
I replaced the images “Default” png located in proj.ios_mac / ios and it works. But how can I scale the image ? Where is the part of code that load this images?
As fas as I know, you can’t manipulate this since the Xcode/iOS itself is integrating it. What you can do is create a SplashScene and display a Sprite object that will serve as your splash image.
After that, I call the method in AppDelegate.cpp (applicationDidFinishLaunching method) just before of director->runWithScene(scene); but It does not work.
What is my error?
I read opinions about modify CCDirector class but I don’t want to do that because if cocos2d is upgraded I need remember always modify the class…
@tranthor
I’m not sure what you’re trying to achieve from your code. I believe you are doing a bit of overwork just to display a splash image. You can use the cocos2d-x Scene Graph to display the image instead of manually swapping the GL buffers.
@macmoy thanks for the answer. But, where should I put that code?
My problem is not how to create an image on the scene, else how to replace the default splash coco2d image when application runs. This image:
Named “Default.png” Located in “proj.ios_mac/ios” folder is the image that loads by default when application runs. My question is: where is the code that loads that image? I can replace the image by another one with the same name, my problem is that I need scale it, and for do that I need know where is the code that load the image, or find another alternative.
As far as I know, we cannot customize how it works as I think it’s integrated in iOS. My workaround for this is make that image a blank black image (or whatever color you want) then make a Scene that will become your Splash screen. In the class, you can do whatever you want. To illustrate, see below:
you open the app --> black image appears (Default.png) --> Splash class will open (custom class you made)
As @macmoy mentioned. This file is loaded by iOS without any code from your app. You can read more about it here. In short: iOS shows this launch screen and after that, it will execute your app code.
PS: The same can be found in Android as described here.
Hey peter , just wanted to know how can i add splash screen without adding a scene at the start of the game . and also i need to disable all the libraries that i am not using so that app size can be reduced , i tried removing some and also physics though i am not using physics its giving me some error, I am using the JS version of cocos. Any help will be appreciable .