Hello Guest

Author Topic: Change FPS on runtime?  (Read 3672 times)

pdform

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 12
    • View Profile
    • The Balance Inc
Change FPS on runtime?
« on: August 25, 2012, 10:11:48 pm »
Hi,

I'd like to change the FPS for some clips at runtime. I've first done something this:

Code: [Select]
animSprite.anim.clips [animSprite.anim.GetClipIdByName ("anim")].fps = newFPS;
However, I've had the terrible experience to discover it changes the FPS in my sprite collection permanently as well, not only in runtime. I'd like to keep the initial FPS for my animation as a reference, and change it proportionally to my objects speed. So, a simple FPS scale attribute would be enough for me, but if I could just change the FPS in runtime without changing it permanently in the project it would be fine too.

So, am I doing something wrong or is it the actual expected behavior?

Thanks!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Change FPS on runtime?
« Reply #1 on: August 25, 2012, 10:35:25 pm »
That is expected behaviour, more or less, and I am aware it isn't ideal. In the next version, I will have a time-scale style override, but for now you could always duplicate the clip and change it on that before playing?