首页 > 其他 > 详细

cocos2dx3.2 spine动画

时间:2014-09-22 15:29:54      阅读:1181      评论:0      收藏:0      [点我收藏+]


        NEWSkeletonAnimation* skeletonNode;
skeletonNode = NEWSkeletonAnimation::createWithFile("Maid.json", "Maid.atlas", 0.6f);

	skeletonNode->startListener = [this] (int trackIndex) {
		spTrackEntry* entry = spAnimationState_getCurrent(skeletonNode->state, trackIndex);
		const char* animationName = (entry && entry->animation) ? entry->animation->name : 0;
		log("%d start: %s", trackIndex, animationName);
	};
	skeletonNode->endListener = [=] (int trackIndex) {
		log("%d end", trackIndex);
		m_isSkeletonSiwtch = false;
	};
	skeletonNode->completeListener = [] (int trackIndex, int loopCount) {
		log("%d complete: %d", trackIndex, loopCount);
	};
	skeletonNode->eventListener = [] (int trackIndex, spEvent* event) {
		log("%d event: %s, %d, %f, %s", trackIndex, event->data->name, event->intValue, event->floatValue, event->stringValue);
	};

	skeletonNode->setPosition(100, 100);
	this->addChild(skeletonNode);
	//skeletonNode->setAnimation(0, "Event", false);








cocos2dx3.2 spine动画

原文:http://my.oschina.net/ffs/blog/316972

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!