Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[~] Added a returnPlay property to MovieClip. #816

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

B-Interactive
Copy link

This is a feature I've put into a current project. When enabled, the clip will play to the end, then effectively play in reverse back to the start, in a back-forth way. I thought I'd see if it could be worked into the MovieClip class as a built in property.

In effect, it replicates the existing frames and adds them in reverse to the MovieClipFrames vector.

In handling things like numFrames and currentFrame, I've obscured the return value to only reflect the original clip. The reasoning is I thought it'd be easier for people to continue treating the clip as unchanged in length and framecount, it simply plays in reverse when it gets to the end.

I'm uncertain if currentTime should be obscured in the same way, my gut feeling is it should remain unobscured, so the full play time back and forth, is twice the normal play time.

When adding and removing frames to a clip, if returnPlay is active, the logic works like this:
if (returnPlay == true)
returnPlay = false: remove the mirrored frames
add or remove frames
returnPlay = true: re-mirror the frames

There's perhaps a more elegant way to do this rather than destroying and re-creating all the mirrored frames each time, but it's not something I anticipate needs to be done too frequently so I've left it for now.

Known quirks: The first and last frames of the clip are doubled. I'm not sure if this is an issue, or expected behaviour?

… effect, play to the end, then play in reverse. I've tried to make it play nice with all other MovieClip methods.
@PrimaryFeather
Copy link
Contributor

Thanks a lot for the pull request!
I'm currently working at bug fixes and performance improvements of Starling 2, but as soon as that's done, I'll have a detailed look at your proposal. Thanks for your efforts! 😄

@B-Interactive
Copy link
Author

No worries Daniel, all that you're doing in Starling 2 is hugely
appreciated 😀

David

On 22 March 2016 at 23:07, Daniel Sperl [email protected] wrote:

Thanks a lot for the pull request!
I'm currently working at bug fixes and performance improvements of
Starling 2, but as soon as that's done, I'll have a detailed look at your
proposal. Thanks for your efforts! [image: 😄]


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#816 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants