this is my sprite init code:
CGSize s = [[CCDirector sharedDirector] winSize];
mgr = [[CCSpriteSheet spriteSheetWithFile:@"lvl1_anim1024.png" capacity:50] retain];
pet_shadow = [mgr createSpriteWithRect: CGRectMake(0,755, 97, 15)];
pet_sprite = [mgr createSpriteWithRect: CGRectMake(0,0, 109, 82)];
[pet_sprite addChild:pet_shadow z: 0 tag: 0];
pet_shadow.anchorPoint = ccp(0, 0.3);
[pet_sprite setPosition: ccp(s.width / 2, s.height / 2 - 80)];
pet_sprite.scale = 1.0f;
[mgr addChild: pet_sprite z:0 tag:1];
[self addChild:mgr];
I've upload a vid show the problems:
-the shadow doesnt move with the body.
-And for some reason theres a second shadow at bottom left of the screen.
- is there anyway i can render child node first? right now shadow is already render after the body because its the child node.
| Get the Video Player |
THanks.