hiulit / aseprite-to-godot-variables

A Lua script to create arrays of colors and indexes of those colors from an Aseprite sprite to be used in Godot.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Aseprite to Godot variables

A Lua script to create arrays of colors and indices of those colors from an Aseprite sprite to be used in Godot.

Aseprite

A sprite in Aseprite.

Code

Output code from the script.

Prerequisites

  • Aseprite >= v1.2.10-beta3.
  • The Sprite Color Mode must be set to RGB Color.

πŸ› οΈ Installation

  • Go to File > Scripts > Open Scrtips Folder.
  • Copy aseprite_to_godot_variables.lua to that folder.

πŸš€ Usage

  • Go to File > Scripts > aseprite_to_godot_variables.
  • When you are asked "Do you want to run the following script?", click Run.
  • Then you'll get another dialog saying that the script wants to access to a file. Click Allow Write Access.
  • You'll get a final dialog informing you where the ouput file is saved.

By default, the output file is saved to Aseprite's scripts folder (where the script is installed), but you can create a new folder here and use the output_dir_name variable to save the output file to that folder. See Output directory name.

βš™οΈ Configurable variables

Output directory name

Name Type Description Default
output_dir_name string Add an output directory to organize the output files. ""

You can optionally add an output directory (only if you previously created it in Aseprite's scripts folder!) to better organize the output files from this script, so they don't mix with other Aseprite's scripts you might have.

Output file extension

Name Type Description Default
output_file_ext string The output file extension. .txt

Color indices array name

Name Type Description Default
color_indices_array_name string The name of the output variable for the color indices array. _sprite

Colors array name

Name Type Description Default
colors_array_name string The name of the output variable for the colors array. _colors

πŸ—’οΈ Changelog

See CHANGELOG.

πŸ‘€ Author

hiulit

🀝 Contributing

Feel free to:

πŸ™Œ Supporting this project

If you love this project or find it helpful, please consider supporting it through any size donations to help make it better ❀️.

Become a patron

Suppor me on Ko-Fi

Buy me a coffee

Donate Paypal

If you can't, consider sharing it with the world...

... or giving it a star ⭐️.

Thank you very much!

πŸ‘ Credits

Thanks to:

  • ruccho - For the Generate Normal Map script, which I used to learn how to get the pixels and its colors from a sprite.
  • AlΓ­cia Folgarona Ribot (@pingudroid) - For creating the sprite in the example.

πŸ“ Licenses

About

A Lua script to create arrays of colors and indexes of those colors from an Aseprite sprite to be used in Godot.

License:MIT License


Languages

Language:Lua 100.0%