I have just started using cocos2d and can't solve this one nice by myself.
I want to create a sprite, add another sprite as it child, and then display it all. I wan't to change their size also, as my images are to big for my screen so I am scaling my sprites. The problem is that when I scale my parent sprite its scale is applied to child, so simple scaling isn't a solution, I need to change actual texture. I am kinda stack right now. Can anybody help me?
CCSprite* parent = [CCSprite spriteWithFile: @"some_picture.png"];
parent.position = ccp(300, 300);
[parent setSizeX:400 andY:400]; //currently this function added in category just scales sprite
CCSprite* child = [CCSprite spriteWithFile: @"some_other_picture.png"];
child.position = ccp(200, 200);
[child setSizeX:200 andY:200]; //currently this function added in category just scales sprite
[parent addChild:child];
[someCCLayer addChild:parent];
So I need a solution for this set size function.
Many thanks!