Starling-Framework icon indicating copy to clipboard operation
Starling-Framework copied to clipboard

Add ability to play a section in a MovieClip

Open tsangwailam opened this issue 12 years ago • 4 comments

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.

tsangwailam avatar Mar 09 '13 09:03 tsangwailam

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. ;-)

PrimaryFeather avatar Mar 11 '13 11:03 PrimaryFeather

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.

tsangwailam avatar Mar 11 '13 13:03 tsangwailam

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");

LorenzGit avatar Jun 24 '13 18:06 LorenzGit

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).

ericsoco avatar Jun 24 '13 19:06 ericsoco