开发者

CCSpriteBatchNode changes opacity of frame - Cocos2d

开发者 https://www.devze.com 2023-03-01 15:36 出处:网络
When I add a sprite to my scene from [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:

When I add a sprite to my scene from

[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:
     @"b.plist"];

    bspriteSheet = [CCSpriteBatchNode batchNodeWithFile:@"b.png"];

    [self addChild:bspriteSheet z:-1];

the opacity of the sprite is lighter than it was originally and the images look fine in "开发者_如何学Pythonb.png". Does anyone know why it is doing this and is there a way to fix it?


Possibly because it's z-index is behind another view which is then somehow masking it. Try changing the z-index to 0 or 1 and see if that works.

0

精彩评论

暂无评论...
验证码 换一张
取 消