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

having issues setting framerate #54

Open
stevenalanstark opened this issue Aug 24, 2017 · 6 comments
Open

having issues setting framerate #54

stevenalanstark opened this issue Aug 24, 2017 · 6 comments

Comments

@stevenalanstark
Copy link
Contributor

stevenalanstark commented Aug 24, 2017

Hello,

I am trying to experiment with the framerate property, but I can't seem to change the framerate.

upon reading the docs, I see that it mentions 'This feature is dependent on the tick event object (or an object with an appropriate 'delta' property) being
passed into {{#crossLink 'Stage/update'}}{{/crossLink}}.`, which is the same comment from CreateJS's MovieClip class, here: http://www.createjs.com/docs/easeljs/files/easeljs_display_MovieClip.js.html

It's confusing that the comment is the same between pixi-animate and createJS, is this intentional?

so, since nothing I have done seems to change the framerate of my clips, I assume that I'm not passing the delta into the stage/update method, is there an example someplace of this working I could reference?

[UPDATE] I was able to increase the framerate, but I need to set clip.framerate recursively across all children.

thank you

@stevenalanstark
Copy link
Contributor Author

stevenalanstark commented Aug 24, 2017

Actually I do see an issue in my test here.

In my test app I have a button that will double the fps, from 30 to 60 to 90 to 120. It stops at 120.

if I press the button, as many times as I like, before triggering the timeline animations, it play as expected. Everything works!

However...

if I play the movieclip animation and, either during the animation or well after it has stopped, I then press my double speed button. In this case, where the animation has played already, pressing the speed button will break the animation. The transitions are no longer timed properly with the fps, and then do not animate properly any more. Is there an update call I need to do or something for the timeline animations to be updated in this case?

@bigtimebuddy
Copy link
Contributor

There is currently no API for dynamically changing the framerate in the way you are suggesting. This definitely could be improved (and is a good feature to add!). We might even consider a convenience speed property which specifically designed to be changed dynamically.

Right now, the framerate is set when you add a new MovieClip, if it doesn't have a framerate set or if there's not a framerate provided in the MovieClip's constructor, it inherits it from the parent's framerate. However, there could definitely be issues with this, as you found out, when changing it after-the-fact.

One thing to note, if you are changing framerate recursively, you should make sure you loop through _timedChildTimelines not children property. Since children MovieClips are added and removed during playback they might not be all on the children property.

@stevenalanstark
Copy link
Contributor Author

oh, well this is interesting then. _timedChildTimelines is always empty in my project, both before and after triggering the animation

@bigtimebuddy
Copy link
Contributor

Could you possibly make a jsfiddle or upload a version of what you're building? It would be useful to see what's breaking.

@stevenalanstark
Copy link
Contributor Author

I will when I have a bit of spare time, as I don't actually require runtime framerate changes just yet. I was just reporting a bug for the most part.

@stevenalanstark
Copy link
Contributor Author

I tried to make a JSFiddle today, but I got stuck trying to provide the shapes.json file.

do you have an example for showing a published scene in JSFiddle?

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

No branches or pull requests

2 participants