In cocos2d, the z order of any sprite can be changed programmatically during execution.
Syntax:
    CCSprite * Sprite = [CCSprite spriteWithFile:@"spriteFileName.png"];
    Sprite.position = ccp(250,150);
    [self addChild:Sprite z:1];
        ...
        ...
        ...
    [self reorderChild:Sprite z:5];        // reordering position
                                                        // z  from 1 to 5 means bottom to top  
No comments:
Post a Comment