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

How ticker.speed works #3431

Closed
readygosports opened this issue Dec 9, 2016 · 3 comments
Closed

How ticker.speed works #3431

readygosports opened this issue Dec 9, 2016 · 3 comments
Labels
🤔 Question User question, similar to Help Wanted or Needs Help. These can be addressed whenever someone has tim

Comments

@readygosports
Copy link

As document says
// Scales ticker.deltaTime to what would be
// the equivalent of approximately 120 FPS
ticker.speed = 2;

if i set ticker.speed = .5 the whole render should play at 30fps?right?
but it does not work.

@staff0rd staff0rd added the 🤔 Question User question, similar to Help Wanted or Needs Help. These can be addressed whenever someone has tim label Dec 11, 2016
@themoonrat
Copy link
Member

themoonrat commented Jan 2, 2017

PIXI only renders when you tell it to render. If you hook it up to requestAnimationFrame, then that gets called whenever the browser can draw again; changing the shared ticker does not effect this at all.

Even if you did hook up renderer.render to a PIXI ticker, it would still call back 60 times a second. You see, the speed factor effects the deltaTime value that is passed in when a ticker updates, not how often it is called.

So, if the game was running at 60fps, then at a scale of 1, then the tick update would be called 60 times a second, each time with a deltaTime of 1. But if you set the scale to 0.5, then the tick update would be called 60 times a second, but with the deltaTime of 0.5.

@readygosports Could you provide a jsfiddle of what you mean please if the above doesn't cover your question :)

@GoodBoyDigital
Copy link
Member

Closing as this seems answered! Cheers!

@lock
Copy link

lock bot commented Feb 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🤔 Question User question, similar to Help Wanted or Needs Help. These can be addressed whenever someone has tim
Projects
None yet
Development

No branches or pull requests

4 participants