Author Topic: sprite "timing"  (Read 2878 times)

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
sprite "timing"
« on: 2005-07-30, 08:07:37 PM »
what was that function that told you how many frames would pass by in a sprites animation? it was something where you put in the number of frames and the speed of the animation
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
sprite "timing"
« Reply #1 on: 2005-07-31, 07:27:55 AM »
Umm... SpriteTemplate.AnimSpeed determines how long each frame of a sprite animation is displayed before advancing to the next frame, but I doubt that's what you're asking because that has to do with scripting and you're posting in General, so you may have to be more specific about what you're looking for.

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
sprite "timing"
« Reply #2 on: 2005-07-31, 09:16:56 AM »
mmm, it was just a little equation that told you, based on the sprites anim. speed and length, how many frames would pass for the animation to cycle once. like, for exanmple, i used it to figure out how long to make hte delay in a path for an explosion animation so that it would delete itsself at the end of the path, which would be hte same frame as teh end of the animation (before it looped).
it used to be on one of your documentations in sourceforge, but i havent been able to find it.
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
sprite "timing"
« Reply #3 on: 2005-07-31, 06:29:01 PM »
I think it would be something like:
frames * (26 - speed)

where frames is the number of frames in the sprite state and speed is the number that shows up in the tooltip on the sprite's slider bar.

That only works if you don't have the movement speed correlated with the animation speed.