Starling-Framework
Starling-Framework copied to clipboard
Add ability to play a section in a MovieClip
Now, Movieclip only allow play and loop all frames. I have add ability to play only a section in the Movieclip. You can use play( startFrame, sectionLength) to play a section within the movieclip.
If you have a animation with different state, you can use only one Moveclip to represent all states. So, no need to use different move clip for different state. Best if you have a character with different animation.
Thanks for the pull request! I'll have to look at this in detail -- I had lots of problems with the movie clip lately (dispatching COMPLETE events in all possible situations, etc.), so I have to be 100% sure everything works fine. ;-)
It is change with the last version of your commit. But i think it have some redundancy of my code. I may have some more optimise on it.
That would indeed be useful! I was actually imagining something like this:
var mc:MovieClip = new MovieClip(); mc.addAnimation(vectorOfTextures, "animation1"); mc.addAnimation(vectorOfTextures, "animation2");
mc.play("animation1"); //or mc.play("animation2");
Note: there may be some overlap with the "bounce" loop and reverse playback I implemented in this pull request: https://github.com/PrimaryFeather/Starling-Framework/pull/343
All these features sound useful, I think we have to wait for Daniel to find time for this due to both the complexity in MovieClip and the frequency of its use (needs thorough testing).