Questions tagged [cclayer]

CCLayer is a class from the popular Cocos2d engine

CCLayer is a class from the popular Cocos2d engine.

Complete API Reference.

115 questions
0
votes
2 answers

memory issue when passing the cclayer to my objects

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 =…
nano
  • 2,511
  • 4
  • 25
  • 42
0
votes
1 answer

Timer condition being passed twice, using cocos2d scheduler

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…
0
votes
1 answer

Drawing with cocos2d

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…
Echilon
  • 10,064
  • 33
  • 131
  • 217
0
votes
1 answer

How to access property from CCLayer?

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…
the_critic
  • 12,720
  • 19
  • 67
  • 115
0
votes
3 answers

Fading CCLayerColor does not work

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 :…
the_critic
  • 12,720
  • 19
  • 67
  • 115
0
votes
1 answer

CCLayerColor curious background apperance

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…
Alex
  • 10,869
  • 28
  • 93
  • 165
0
votes
3 answers

cocos2d how do I prevent multi touch propagation to previous layers?

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…
Agustin
  • 163
  • 2
  • 9
0
votes
1 answer

Determine if CCLayer is currently rotating

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…
MrDatabase
  • 43,245
  • 41
  • 111
  • 153
0
votes
1 answer

Settings screen in Cocos2D game

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…
SundayMonday
  • 19,147
  • 29
  • 100
  • 154
-2
votes
1 answer

add cclayer on top of another

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…
stack
  • 951
  • 3
  • 9
  • 23
1 2 3 4 5 6 7
8