【发布时间】:2014-12-29 08:13:01
【问题描述】:
我正在尝试制作一个 Spritebuilder iPhone 游戏,我的主要角色 _player 是一个 CCNode,其子节点是一个 CCBFile,其中包含角色的空闲动画。
我想将这个 _player 的 CCBFile 更改为另一个名为 ForwardDash.ccbi 的 CCBFile,其中包含玩家触摸屏幕时的“攻击”动画。
这就是我正在尝试的:
//_player is a CCNode, its first child is the CCBFile with the idle animation.
//animar is a pointer to the CCBFile with the ForwardDash animation
CCSprite *wat = _player.children[0];
CCNode *animar = [CCBReader load:@"ForwardDash"];
[wat setSpriteFrame: (CCSpriteFrame*)animar];
它失败并给我错误:'Thread 1: signal SIGABRT'
【问题讨论】:
-
那是因为 animar 是一个 CCNode(或子类)实例,而不是 CCSpriteFrame
标签: ios animation cocos2d-iphone spritebuilder