sprite kit - SKAction go to and stop at a specific frame -


flash has gotoandplay() , gotoandstop() methods movie clips skip frame. don't see methods in skaction class there way or workaround simulate skaction instances?

edit: additional info on gotoandplay , gotoandstop: gotoandplay(n) brings playhead nth frame. if clip 30 frames long , call gotoandplay(15) start playing 15th frame , stop @ 30. gotoandstop(n) takes animation nth frame , stops there without playing.

there no action play frame x y. it's easy replicate because animate actions..

+ (skaction *)animatewithtextures:(nsarray *)textures                       timeperframe:(nstimeinterval)sec 

.. take array of textures input. either create array specific frame textures want play, or if have array allframes textures can new array desired frames if wanted play frame 15 end:

nsrange range = nsmakerange(15, allframes.count - 15); nsarray* animframes = [allframes subarraywithrange:range]; skaction anim = [skaction animatewithtextures:animframes timeperframe:0.1]; 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -