I've got a CCLayer where I want to add many buttons.
I created the class MyButton with this init function:
-(id) initWithLayer:(MyLayer *)theLayer andDictionary:(NSDictionary *)data {
self = [super init];
if (self != nil)
{
self.layer =…
I can't for the life of my work out why this is happening. I have in a class derived from CCLayer. I am scheduling a method call like so when initialising the class
//create an update method for keeping track of how long its been since an animation…
I'm overriding the draw method of CCLayerColor to draw a border, but the color does not change. I've tried ccDrawXxxx and they all only ever use white as the color. I've also tried glColor4ub with the same effect. This is all I have in my draw…
I am adding a layer to my scene and I want to check when it is fully loaded by setting a boolean after my initialization called doneInitializing to YES. But i need to access it somehow... How do I do that ?
LoadingScreen.h
@interface LoadingScreen…
I would like to fade a CCLayerColor, which seems to be pretty straightforward, but it just does not work ... Here is what I do :
LoadingScreen.h
@interface LoadingScreen :…
I inherit a class named FinishedLevelLayer from CCLayerColor and declare an empty init. in my class i declare a CCMenu, but when i show the menu, i get a weird black background for the layer. The background isn't full screen. How can i avoid…
I'm handling the touches manualy through a class that holds every touchable sprite. Also, every menu is a CCLayer, and when I change from one menu to the other, I use the CCTransition### and get the new scene.
So, the layers are "still there" and…
I'm rotating an instance of a CCLayer subclass like this:
[self runAction:[CCRotateBy actionWithDuration:0.5 angle:180.0]];
This rotating is in response to a user tap (which may come rapidly). How can I determine if the layer is currently being…
How are settings screens created in Cocos2D games?
I've considered using a UIViewController subclass however pushing it in Cocos2D seems hacky. I've also considered using a CCLayer with buttons etc as child nodes. Then I could animate this layer…
I want to add one cclayer on top of another.
I have tried this by using following code
+(id) scene
{
CCScene *scene = [CCScene node];
GameScreen *layer = [GameScreen node];
[scene addChild: layer];
GameScreen *newLayer=[GameScreen node];
[scene…