cocos2dx spine动画反转

	SkeletonAnimation *m_pSpine= SkeletonAnimation::createWithJsonFile("spinefile.json", "spinefile.atlas", 1.0F);
	//m_pSpineBrow->setSkin("skinname1");
	//auto slot = spSkeleton_findSlot(m_pSpineBrow->getSkeleton(), "slotnamne1");
	//auto slot1 = spSkeleton_findSlot(m_pSpineBrow->getSkeleton(), "slotnamne2");
	//auto slot1atta = slot1->attachment;
	//m_pSpine->setAttachment("spinefile", "spinefile");
	m_pSpine->setSkin("skinname");
	m_pSpine->getSkeleton()->flipX = 1;
	m_pSpine->setAnimation(0, "aniname", true);   //dk, dx,fn,qw,sj,xm   //六个表情的资源

注:

  1. spine动画的销毁直接通过父节点removeChild可能会出错,一般使用RemoveSelf动画方式删掉自己
  2. 有些Skin替换不能生效,尝试绑定骨骼或者与美术制作人员核对皮肤正确性
  3. 下面这种情况没遇到过,记录一下,网友在2.2.6版本遇到的问题
    https://forum.cocos.org/t/cocos2dx-2-2-6-spine-skin-orz/30738
_enemyNode = new CCSkeletonAnimation(Fighting"pk-character.json", Fighting"character.atlas");
_enemyNode->setBonesToSetupPose();
_enemyNode->setSkin("enemy");
_enemyNode->setScale(-0.5, 0.5);
_enemyNode->setSlotsToSetupPose();//开始就是没调用这个方法 , 将slot也就是皮肤上的部分关联到骨骼上
_enemyNode->setAnimation("idle", true);
_enemyNode->debugBones = false;

你可能感兴趣的:(游戏开发)