compiler.rst 1.3 KB

12345678910111213141516171819202122232425262728
  1. .. include:: ../_header.rst
  2. Compiling animation key constants
  3. ---------------------------------
  4. You can enable compiling a code file with constant definitions for the animation keys.
  5. For each animation, the compiler will generate a constant declaration. Like this:
  6. .. image:: ../images/animtions-editor-compiler-20221114.webp
  7. :alt: Animations constants compiler.
  8. If you have a lot of animations in your game, we recommend using this feature. You can reference animations using constants (and auto-completion) instead of writing the key names "by hand".
  9. By default, the compiler is disabled. You can enable it in the **Compiler Settings** section. This section shows when no animation is selected:
  10. .. image:: ../images/animations-editor-compiler-settings-20221114.webp
  11. :alt: Compiler settings.
  12. This a table with the parameters:
  13. * **Generate Code**: Enable the code generation.
  14. * **Output Language**: Choose between JavaScript and TypeScript.
  15. * **ES Module**: If selected, it generates an ES module file.
  16. * **Output Folder**: Choose the parent folder for the output file. If you are using a WebPack or similar bundler, you may want to generate the code in a sub-directory of the `src` folder.
  17. .. image:: ../images/animations-editor-select-output-folder-20221114.webp
  18. :alt: Select the output folder.