spineAnimation为创建的spine骨骼动画。

spineAnimation:registerSpineEventHandler(function (event)
    dump(event)
end, sp.EventType.ANIMATION_END)

事件有以下类型:

sp.EventType =
{
    ANIMATION_START = 0, 
    ANIMATION_END = 1, 
    ANIMATION_COMPLETE = 2, 
    ANIMATION_EVENT = 3,
}
注:不在在骨骼动画事件中调用spineAnimation:removeFromParent(), spine runtime会异常的。用调度器来解决这个问题。

标签: Cocos2d-x

添加新评论