Open massivepenguin opened 10 years ago
@massivepenguin massivepenguin Maybe is a bit late :), but here is a nice article http://www.raywenderlich.com/59535/integrating-spine-spritekit-tutorial
Ray just added a new method in the DZSpineSceneBuilder.m . @simonkim Maybe this can be added into this repo? Would be benefic for others as well.
(void)runAnimationName:(NSString )animationName skeleton:(SpineSkeleton )skeleton loop:(BOOL)loop {
SpineAnimation *animation = [skeleton animationWithName:animationName]; if (!animation) { NSLog(@"No such animation: %@", animation.name); return; }
DZSpineSpriteKitAnimation *skAnimation = [[DZSpineSpriteKitAnimation alloc] initWithSkeleton:skeleton maps:self.maps];
// Bone Animations //[skAnimation chainAnimations:[animations copy] rootBone:bone rootNode:root loop:loop]; [skAnimation applyBoneAnimations:@[animation] loop:loop];
// Slot Animations [skAnimation applySlotAnimations:@[animation] loop:loop]; }
@ggili How about sending a pull request?
I've been reading the docs trying to find an answer, but I'm still not sure how to trigger an animation on a skeleton once the scene has loaded. Would I need to set up a reference to the animation and call that, or is there something more straightforward that I'm missing?