# lv_rlottie.h (/api/public/widgets/lv_rlottie_h)



<RelatedHeaders name="lv_rlottie_private.h" isPrivate="false" />

<ApiSummary functions="4" enums="1" macros="1" variables="1" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (2)&#x22;,&#x22;Other (2)&#x22;]">
  <ApiTab value="Setters (2)">
    <ApiMember kind="function" name="lv_rlottie_set_play_mode" file="public/widgets/lv_rlottie.h" line="93" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_rlottie.h#L93">
      lv_rlottie_set_play_mode [#lv_rlottie_set_play_mode]

      Set how the animation is played.

      \> &#x2A;*Deprecated:** rlottie is deprecated. Use the `lv_lottie` widget instead.

      ```c title=" " lineNumbers=1
      void lv_rlottie_set_play_mode(lv_obj_t *rlottie, const lv_rlottie_ctrl_t ctrl)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name      | Type                                                                   | Description                                                             |                                                                                                                                |
      | --------- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
      | `rlottie` | <ApiLink name="lv_obj_t" display="lv_obj_t *" />                       | pointer to an rlottie widget                                            |                                                                                                                                |
      | `ctrl`    | <ApiLink name="lv_rlottie_ctrl_t" display="const lv_rlottie_ctrl_t" /> | OR-ed values of `lv_rlottie_ctrl_t`, e.g. \`LV\_RLOTTIE\_CTRL\_BACKWARD | LV\_RLOTTIE\_CTRL\_LOOP`. Without `LV\_RLOTTIE\_CTRL\_LOOP`an`LV\_EVENT\_READY\` event is sent when the last frame is reached. |
    </ApiMember>

    <ApiMember kind="function" name="lv_rlottie_set_current_frame" file="public/widgets/lv_rlottie.h" line="104" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_rlottie.h#L104">
      lv_rlottie_set_current_frame [#lv_rlottie_set_current_frame]

      Jump to a given frame of the animation.

      \> &#x2A;*Deprecated:** rlottie is deprecated. Use the `lv_lottie` widget instead.

      ```c title=" " lineNumbers=1
      void lv_rlottie_set_current_frame(lv_obj_t *rlottie, const size_t goto_frame)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name         | Type                                             | Description                                                                                                 |
      | ------------ | ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- |
      | `rlottie`    | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to an rlottie widget                                                                                |
      | `goto_frame` | `const size_t`                                   | zero based index of the frame to show. Values not smaller than the total frame count select the last frame. |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (2)">
    <ApiMember kind="function" name="lv_rlottie_create_from_file" file="public/widgets/lv_rlottie.h" line="63" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_rlottie.h#L63">
      lv_rlottie_create_from_file [#lv_rlottie_create_from_file]

      Create an rlottie animation from a JSON file. The animation starts playing forward in a loop right away.

      rlottie doesn't use LVGL's File System API.

      \> &#x2A;*Deprecated:** rlottie is deprecated. Use the `lv_lottie` widget instead.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_rlottie_create_from_file(lv_obj_t *parent, int32_t width, int32_t height, const char *path)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type                                             | Description                                                                                                        |
      | -------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
      | `parent` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a parent widget **May** be `NULL`.. When NULL, the widget is created as a screen on the active display. |
      | `width`  | `int32_t`                                        | width of the animation and its render buffer in pixels                                                             |
      | `height` | `int32_t`                                        | height of the animation and its render buffer in pixels                                                            |
      | `path`   | `const char *`                                   | path to a json file, e.g. "path/to/file.json"                                                                      |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — pointer to the created rlottie widget, or NULL if `path` is NULL
    </ApiMember>

    <ApiMember kind="function" name="lv_rlottie_create_from_raw" file="public/widgets/lv_rlottie.h" line="79" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_rlottie.h#L79">
      lv_rlottie_create_from_raw [#lv_rlottie_create_from_raw]

      Create an rlottie animation from a raw JSON description. The animation starts playing forward in a loop right away.

      \> &#x2A;*Deprecated:** rlottie is deprecated. Use the `lv_lottie` widget instead.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_rlottie_create_from_raw(lv_obj_t *parent, int32_t width, int32_t height, const char *rlottie_desc)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name           | Type                                             | Description                                                                                                        |
      | -------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
      | `parent`       | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a parent widget **May** be `NULL`.. When NULL, the widget is created as a screen on the active display. |
      | `width`        | `int32_t`                                        | width of the animation and its render buffer in pixels                                                             |
      | `height`       | `int32_t`                                        | height of the animation and its render buffer in pixels                                                            |
      | `rlottie_desc` | `const char *`                                   | the lottie animation as a nul terminated string                                                                    |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — pointer to the created rlottie widget, or NULL if `rlottie_desc` is NULL
    </ApiMember>
  </ApiTab>
</ApiTabs>

Enums [#enums]

<ApiMember kind="enum" name="lv_rlottie_ctrl_t" file="public/widgets/lv_rlottie.h" line="34" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_rlottie.h#L34">
  lv_rlottie_ctrl_t [#lv_rlottie_ctrl_t]

  | Name                       | Value |
  | -------------------------- | ----- |
  | `LV_RLOTTIE_CTRL_FORWARD`  | `0`   |
  | `LV_RLOTTIE_CTRL_BACKWARD` | `1`   |
  | `LV_RLOTTIE_CTRL_PAUSE`    | `2`   |
  | `LV_RLOTTIE_CTRL_PLAY`     | `0`   |
  | `LV_RLOTTIE_CTRL_LOOP`     | `8`   |
</ApiMember>

<TypeUsedBy name="lv_rlottie_ctrl_t" count="1">
  * `lv_rlottie_set_play_mode` — param `ctrl`
</TypeUsedBy>

Macros [#macros]

<ApiMember kind="macro" name="LV_RLOTTIE_DEPRECATED_MSG" file="public/widgets/lv_rlottie.h" line="28" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_rlottie.h#L28">
  LV_RLOTTIE_DEPRECATED_MSG [#lv_rlottie_deprecated_msg]

  ```c title=" " lineNumbers=1
  #define LV_RLOTTIE_DEPRECATED_MSG "rlottie is deprecated; use the lv_lottie widget instead."
  ```

  \> &#x2A;*Deprecated:** The rlottie player is deprecated and kept only for backward compatibility. Use the `lv_lottie` widget instead. See the Lottie widget docs.
</ApiMember>

Variables [#variables]

<ApiMember kind="variable" name="lv_rlottie_class" file="public/widgets/lv_rlottie.h" line="42" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_rlottie.h#L42">
  lv_rlottie_class [#lv_rlottie_class]

  ```c title=" " lineNumbers=1
  const lv_obj_class_t lv_rlottie_class
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_conf_internal.h&#x22;, &#x22;lv_types.h&#x22;]" includedBy="[&#x22;lvgl.h&#x22;]" />
