CCSpriteFrame警告..AnchorPoint不能按预期工作。重新生成.plist?

问题描述:

我有一只母鸡,我自己用的是非常好的教程由射线wenderlichCCSpriteFrame警告..AnchorPoint不能按预期工作。重新生成.plist?

http://www.raywenderlich.com/1271/how-to-use-animations-and-sprite-sheets-in-cocos2d

试图动画(母鸡行走),但我一次又一次地得到这个警告的三个简单的图像,并没有精灵表演在CCSpriteFrame上找不到原始宽度/高度 。 AnchorPoint无法按预期工作。重新生成.plist 我尝试调整大小和不修剪,但错误仍然存​​在...我无法弄清楚问题?我的继承人代码

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

    CCSpriteBatchNode *spriteSheet = [CCSpriteBatchNode batchNodeWithFile:@"hentry.png"]; 
    [self addChild:spriteSheet]; 

    // Load up the frames of our animation 
    NSMutableArray *walkAnimFrames = [NSMutableArray array]; 
    for(int i = 2; i <= 3; ++i) { 
     [walkAnimFrames addObject:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@"%d.png", i]]]; 
    } 
    CCAnimation *walkAnim = [CCAnimation animationWithFrames:walkAnimFrames delay:0.1f]; 

    // Create a sprite 
    CGSize winSize = [CCDirector sharedDirector].winSize; 
    self.bear = [CCSprite spriteWithSpriteFrameName:@"2.png"]; 
    _bear.position = ccp(winSize.width/2, winSize.height/2); 
    self.walkAction = [CCRepeatForever actionWithAction:[CCAnimate actionWithAnimation:walkAnim restoreOriginalFrame:NO]]; 
    [_bear runAction:_walkAction]; 
    [spriteSheet addChild:_bear]; 

转到Zwoptex菜单,选择引用...
选择精灵表标签 更改 “坐标格式”,以的cocos2d,而不是Zwoptex通用

alt text

+0

In v Cocos2D的0.99.4和Zwoptex的1.16,看来导出到Cocos2D坐标不起作用。我设法通过导出到Zwoptex Flash版本来生成正确的.plist文件。如果这不起作用,则手动导出纹理和坐标(文件>导出纹理,文件>导出坐标)作为Zwoptex Flash。 – dianovich 2010-12-20 13:02:05