나는 cocos2d에서 멍청한 놈이다. 나는 cocos2d 문서를 읽고 Ray Wenderlich 튜토리얼에서 스프라이트 시트를 만들려고했지만 지금까지 내가 만든 스프라이트 시트에서 내 스프라이트 중 하나를로드 할 수 없었다. Sprite는 평범한 CCSprite spriteFromFile :을 사용하면 잘 보이고 있습니다. 어쨌든 Zwoptex에서 스프라이트 시트를 만들었습니다. Cocos2d .plist 파일로 코디네이터를 선택했습니다. 끌어서 두 파일 (png 및 plist)을 내 프로젝트 Resources 그룹에 넣고 init 메서드에 다음 코드를 작성합니다.Cocos2d Spritesheet not loading (spriteWithSpriteFrameName)
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"piece.plist"];
CCSpriteBatchNode *pieceSpriteSheet = [CCSpriteBatchNode batchNodeWithFile:@"piece.png"];
[self addChild:pieceSpriteSheet];
CCSprite *block = [CCSprite spriteWithSpriteFrameName:@"pieceB1.png"];
나는 파일, 대문자의 이름을 확인, 심지어 spritesheet 여러 번 다시 만들어하지만 PLIST 및 PNG 거기에 있는데도 여전히적인 Cocos2D는 pieceB1.png를로드 할 수있다. 내가 가진
오류 :
2013-02-11 01:33:04.808 sequence[5787:12203] cocos2d: CCSpriteFrameCache: Trying to use file 'piece.png' as texture
2013-02-11 01:33:04.815 sequence[5787:12203] cocos2d: CCSpriteFrameCache: Frame 'pieceB1.png' not found
2013-02-11 01:33:04.818 sequence[5787:12203] cocos2d: Frame interval: 1
2013-02-11 01:33:04.822 sequence[5787:12203] Application windows are expected to have a root view controller at the end of application launch
2013-02-11 01:33:04.822 sequence[5787:12203] cocos2d: surface size: 640x960
2013-02-11 01:33:07.044 sequence[5787:12203] cocos2d: CCSpriteFrameCache: Frame 'pieceG1.png' not found
2013-02-11 01:33:07.045 sequence[5787:12203] *** Assertion failure in +[CCSprite spriteWithSpriteFrameName:]
감사 다음은 PLIST 파일의 스크린 샷입니다.
프로젝트에 파일을 올바르게 추가 하시겠습니까? ' – bluestunt
예 제가 올바르게 추가 한 것 같습니다. http://i.imgur.com/seAnufn.png – GeneCode