I'm trying to draw a card game. I have a texture with the four colors an I add the number to the card. The problem is that I want they linked together in a class (subclass of layer or something, i've tried everything) but as the texture is loaded in the main layer, the sprite is not drawn.
Right now I have this working
Sprite *sp= [SpriteObject spriteWithRect:CGRectMake(idx*img_w,idy*img_h,img_w,img_h) spriteManager:mgr];
sp.position=ccp(size.width/5+px*img_w*1.5,5*size.height/6-img_h*py);
sp.scale=scale;
sp.rotation=45-rand()%90;
Label *label = [Label labelWithString:[NSString stringWithFormat:@"%d",r_cards[x][1]] fontName:@"Marker Felt" fontSize:60];
[label setColor:ccc3(0,0,0)];
label.position = ccp(size.width/5+px*img_w*1.5,5*size.height/6-img_h*py);
label.rotation=sp.rotation;
[self addChild: label];
[mgr addChild:sp];
But if I outsource this to another class, the label is drawn but not the sprite. Also making [sp addChild:label] won't work.
Any workaround?
Thanks