void ComponentSpine::setAnimation(const graphics::SpineManagerItem * _animation, const int track_index, const bool loop)
{
    auto __animation = * const_cast<graphics::SpineManagerItem *>(_animation);

    updateSpine(__animation);

    spAnimationState_setAnimation(animationState, track_index, __animation.getAnimation(), loop);
}
Example #2
0
spTrackEntry* SkeletonAnimation::setAnimation (int trackIndex, const std::string& name, bool loop) {
	spAnimation* animation = spSkeletonData_findAnimation(_skeleton->data, name.c_str());
	if (!animation) {
		log("Spine: Animation not found: %s", name.c_str());
		return 0;
	}
	return spAnimationState_setAnimation(_state, trackIndex, animation, loop);
}
	spTrackEntry* SpineAnimation::setAnimation(int trackIndex, const char* name, bool loop)
	{
		spAnimation* animation = spSkeletonData_findAnimation(skeleton->data, name);
		if (!animation) {
            return 0;
        }
		return spAnimationState_setAnimation(state, trackIndex, animation, loop);
	}
Example #4
0
spTrackEntry* NEWSkeletonAnimation::setAnimation (int trackIndex, const char* name, bool loop) {
	spAnimation* animation = spSkeletonData_findAnimation(skeleton->data, name);
	if (!animation) {
		log("Spine: Animation not found: %s", name);
		return 0;
	}
	return spAnimationState_setAnimation(state, trackIndex, animation, loop);
}
bool SpineAnimation::setAnimation(JNIEnv* env, int trackIndex, const char* name, bool loop) {
	spAnimation* animation = spSkeletonData_findAnimation(skeleton->data, name);
	if (!animation) {
		callback->onError(env, "Animation not found: %s", (char*) name);
		return false;
	}
	else {
		spAnimationState_setAnimation(state, trackIndex, animation, loop);
		return true;
	}
}
Example #6
0
    bool SpineDrawable::setAnimation(int32_t trackIndex, const std::string& animationName, bool loop)
    {
        spAnimation* animation = spSkeletonData_findAnimation(animationState->data->skeletonData, animationName.c_str());

        if (!animation)
        {
            return false;
        }

        spAnimationState_setAnimation(animationState, trackIndex, animation, loop ? 1 : 0);

        return true;
    }
Example #7
0
void SkeletonAnimationFbo::setAnimation(int trackIndex, const QString& name, bool loop)
{
    if (!isSkeletonValid()){
        qDebug()<<"SkeletonAnimation::setAnimation Error: Skeleton is not ready";
        return;
    }

    spAnimation* animation = spSkeletonData_findAnimation(mspSkeleton->data, name.toStdString().c_str());
    if (!animation) {
        qDebug()<<"SkeletonAnimation::setAnimation Error: Animation is not found:"<<name;
        return;
    }
    spAnimationState_setAnimation(mspAnimationState, trackIndex, animation, loop);
}