0
嗨,如何在Android中顯示的plist文件的Cocos2D
我使用cocos2d的做一個。我想用plist文件顯示動畫。我嘗試過使用plist,但沒有得到。
我的代碼:
public class GamestartLayer1 extends CCColorLayer {
CGSize winSize;
CCSpriteFrameCache cache;
CCSpriteSheet spriteSheet;
protected GamestartLayer1(ccColor4B color) {
super(color);
// TODO Auto-generated constructor stub
winSize = CCDirector.sharedDirector().displaySize();
CCSpriteFrameCache.sharedSpriteFrameCache().addSpriteFrames("anim_default.plist");
spriteSheet = CCSpriteSheet.spriteSheet("anim_default.png");
spriteSheet.setAnchorPoint(0, 0.5f);
spriteSheet.setPosition(CGPoint.make(0, winSize.height/2));
this.addChild(spriteSheet);
}
public static CCScene scene() {
// TODO Auto-generated method stub
CCScene scene = CCScene.node();
CCColorLayer layer = new GamestartLayer1(ccColor4B.ccc4(255, 255, 255, 255));
scene.addChild(layer);
return scene;
}
}
但我正在逐漸寫屏。