.. _api_Animation: Animation ========= Inherited: :ref:`Object` .. _api_Animation_description: Description ----------- The Animation class contain basic state machine to control animation processing. .. _api_Animation_public: Public Methods -------------- +-----------------------------------------------+-----------------------------------------------------------------+ | uint32_t | :ref:`currentLoop` () const | +-----------------------------------------------+-----------------------------------------------------------------+ | uint32_t | :ref:`currentTime` () const | +-----------------------------------------------+-----------------------------------------------------------------+ | int32_t | :ref:`duration` () const | +-----------------------------------------------+-----------------------------------------------------------------+ | bool | :ref:`isValid` () const | +-----------------------------------------------+-----------------------------------------------------------------+ | int32_t | :ref:`loopCount` () const | +-----------------------------------------------+-----------------------------------------------------------------+ | uint32_t | :ref:`loopTime` () const | +-----------------------------------------------+-----------------------------------------------------------------+ | void | :ref:`pause` () | +-----------------------------------------------+-----------------------------------------------------------------+ | void | :ref:`resume` (bool ignore = false) | +-----------------------------------------------+-----------------------------------------------------------------+ | void | :ref:`setCurrentTime` (uint32_t msecs) | +-----------------------------------------------+-----------------------------------------------------------------+ | void | :ref:`setLoopCount` (int32_t loops) | +-----------------------------------------------+-----------------------------------------------------------------+ | void | :ref:`setValid` (bool valid) | +-----------------------------------------------+-----------------------------------------------------------------+ | void | :ref:`start` () | +-----------------------------------------------+-----------------------------------------------------------------+ | :ref:`Animation::State` | :ref:`state` () const | +-----------------------------------------------+-----------------------------------------------------------------+ | void | :ref:`stop` () | +-----------------------------------------------+-----------------------------------------------------------------+ | int32_t | :ref:`totalDuration` () const | +-----------------------------------------------+-----------------------------------------------------------------+ .. _api_Animation_enums: Public Enums ------------ .. _api_Animation_State: **enum Animation::State** This enum defines the state of animation track. +--------------------+-------+--------------------------------------------------------------------------------------------------+ | Constant | Value | Description | +--------------------+-------+--------------------------------------------------------------------------------------------------+ | Animation::STOPPED | 0 | Animation stopped if start() is triggered the animation will start from beginning. | +--------------------+-------+--------------------------------------------------------------------------------------------------+ | Animation::RUNNING | 1 | Animation is playing. | +--------------------+-------+--------------------------------------------------------------------------------------------------+ | Animation::PAUSED | 2 | Animation paused if resume() is triggered the animation will continue from place before pause(). | +--------------------+-------+--------------------------------------------------------------------------------------------------+ .. _api_Animation_static: Static Methods -------------- None .. _api_Animation_methods: Methods Description ------------------- .. _api_Animation_9f61a5d0: uint32_t **Animation::currentLoop** () const Returns the number of repetitions of animation which already has played. ---- .. _api_Animation_ebf73249: uint32_t **Animation::currentTime** () const Returns the current time (in milliseconds) in scope of current loop. **See also** setCurrentTime(). ---- .. _api_Animation_4d12ebfc: int32_t **Animation::duration** () const Returns the duration of the animation (in milliseconds). ---- .. _api_Animation_46a03792: bool **Animation::isValid** () const Returns true in case of animation is valid; otherwise returns false. ---- .. _api_Animation_4bd5fe71: int32_t **Animation::loopCount** () const Returns the number of repetitions of animation; -1 in case of infinite animation. **See also** setLoopCount(). ---- .. _api_Animation_cd6efb01: uint32_t **Animation::loopTime** () const Returns the current time for the current loop (in milliseconds). ---- .. _api_Animation_5dae7430: void **Animation::pause** () Stops the animation. **Note:** Animation CAN be continued by resume(). ---- .. _api_Animation_924ec7d0: void **Animation::resume** (bool *ignore* = false) Continues the animation which was paused earlier. Flag *ignore* can help to skip pause check. ---- .. _api_Animation_049c26d7: void **Animation::setCurrentTime** (uint32_t *msecs*) Sets the new position of animation to provided *msecs* position. **Note:** If new position placed outside of current loop; Then current loop will be changed to appropriate. **See also** currentTime(). ---- .. _api_Animation_084c6afe: void **Animation::setLoopCount** (int32_t *loops*) Sets the new number of *loops* of animation; -1 in case of infinite animation. **See also** loopCount(). ---- .. _api_Animation_9dc1f506: void **Animation::setValid** (bool *valid*) Sets the *valid* state of animation. The invalid animations will not affect anything. **See also** isValid(). ---- .. _api_Animation_531f9e08: void **Animation::start** () Starts the animation from the beginning. ---- .. _api_Animation_1fa254e0: :ref:`Animation::State` **Animation::state** () const Returns the current state of animation. ---- .. _api_Animation_2f86ba7c: void **Animation::stop** () Stops the animation. **Note:** Animation can't be continued. ---- .. _api_Animation_a53db10c: int32_t **Animation::totalDuration** () const Returns the duration (in milliseconds) in total as sum of durations for all loops. **Note:** Returns -1 in case of infinite animation.