是因为spine runtime3.6版本里面有个bug,需要手动修改下或者升级一下spine runtime,我这边为了方便当然选择修改了,没有时间升级,下面附上修改方法
原文为frameworks\cocos2d-x\cocos\editor-support\spine\SkeletonRenderer.cpp里面的269行附近
case SP_ATTACHMENT_CLIPPING: { spClippingAttachment* clip = (spClippingAttachment*)slot->attachment; spSkeletonClipping_clipStart(_clipper, slot, clip) } default: spSkeletonClipping_clipEnd(_clipper, slot); continue; }
修改为
case SP_ATTACHMENT_CLIPPING: { spClippingAttachment* clip = (spClippingAttachment*)slot->attachment; spSkeletonClipping_clipStart(_clipper, slot, clip); continue; //增加此行 } default: spSkeletonClipping_clipEnd(_clipper, slot); continue; }
修改完之后编译一下c++代码,然后再试一下就好了
本文方法来源于
http://zh.esotericsoftware.com/forum/Clipping-features-is-not-avialible-in-cocos2d-x-runtime-9260
https://github.com/EsotericSoftware/spine-runtimes/issues/984