How to set animation duration in the code

I have an Animation whose duration must accord with a value provided by my game. the value is always changed. therefore I need to modify its duration in the code.
but I don't know how to set it. no related function provided in orx. thanks

Comments

  • edited July 2011
    The function you're looking for is orxObject_SetAnimFrequency().
    Note that you can change the frequency directly on the orxANIMPOINTER if you prefer (if you don't know your animation duration, you can also get it from the orxANIMPOINTER but there's no wrapper in orxObject for that one).

    Let me know if you have another issue.
  • edited July 2011
    therefore the formula of the time of a animation key last is frenquncy*duration, am I right.
  • edited July 2011
    Not exactly, it's more like NewDuration = Duration / Frequency.

    If the original duration is 10 sec and your frequency is 5, the new duration is 10 / 5 = 2s.
  • edited July 2011
    I see..
Sign In or Register to comment.