I have the newest cocos2d, Xcode4 and iOS5 SDK. I am testing my app on my iPhone 4 (5.0.1). No crashes occur on the simulator - only on devices.
On first run, my app crashes before entering the first scene, which it does by CCTransitionFade. It…
please look the following picture
i want to do this function,when i click some button,it pop out a layer
my code is
-(id)init{
if (self = [super init]) {
CCMenuItem *successbtn = [CCMenuItemImage itemFromNormalImage:@"success.png"
…
Hello awesome dev community.
I have looked for an answer to this for days now and just can't seem to find a handle, so decided to post Q myself.
I have a game that has menus for picking items.
The menus can have 2 -> 30+ items, so they need to…
Here is the topic on Difference between CCNode::init() and CCNode::onEnter(). However I followed the advice they gave.
void MyLayer::onEnter() {
CCLayer::onEnter();
//your code goes here
}
I got the Assertion failed! error!
MyLayer…
There are a lot of answers for this question. But all of them are incorrect!
For example if I have created a CCLayer object with one CCSprite object. I have 3 textures and I want to switch between them on every touch.
For example I will use…
I want to create a starry sky for some scenes.
The main problem is it needs some time to fill all the screen with particles. Someone advices me to create the whole sky at the beginning and save it between its calls.
I tried something like…
I've been trying to set up the parallax node correctly but need some help with this.
This http://goo.gl/Piqy5 would be the frame of the game and for the parallax node area I have 3 layers:
background layer (zoomable but not scrollable, z order…
I'm working on a species ID app and would like to populate a layer with sprites based on which animal you select on the main layer. I've made each animal a menu item, and can get my info layer to appear when pressing the button, but how can I set it…
I'm using cocos2d CClayer.
I made Submit TextField Class to use submit name.
I followed some blogger and managed to show textFiled, but the shouldChangeCharactersInRange didn't call at all.
How do i call shouldChangeCharactersInRange? (I didn't use…
Is it possible to detect which CCScene is currently showing on the scene? I have 2 CCScenes in my game and I want a certain action to occur if one is showing.
Also quick related question, if I wanted to check if a CCMenu is not showing currently…
In my game, I have a series of avatars, currently each avatar has a small rectangular container to denote that this image is a button and can be clicked.
However, I've realised that I need to change the color of the container to denote a visual…
I created two CCLayers, one is gamelayer, another is howlayer. The code of gamelayer.m is
-(id)init{
if (self = [super init]) {
CCSprite *gamebg = [CCSprite spriteWithFile:@"bg.png"];
gamebg.anchorPoint = CGPointZero;
[self…
I have to add one slider in CCLayer. How to make slider. I went through online and I got there is one object t but which is available in UISlider. If I am implementing it then how will I add it into cclayer?
I m making a small test game for iPad.…
I am finished my cocos2d project, which uses the accelerometer to rotate the current CCLayer for a particular game mechanic. I've always noticed a 10-15 fps drop of which I couldn't find and decided to take look now. I thought it would have…