A Lua script to create arrays of colors and indices of those colors from an Aseprite sprite to be used in Godot.
A sprite in Aseprite.
Output code from the script.
- Aseprite >=
v1.2.10-beta3
. - The Sprite Color Mode must be set to RGB Color.
- Go to File > Scripts > Open Scrtips Folder.
- Copy
aseprite_to_godot_variables.lua
to that folder.
- 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.
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.
Name | Type | Description | Default |
---|---|---|---|
output_file_ext |
string |
The output file extension. | .txt |
Name | Type | Description | Default |
---|---|---|---|
color_indices_array_name |
string |
The name of the output variable for the color indices array. | _sprite |
Name | Type | Description | Default |
---|---|---|---|
colors_array_name |
string |
The name of the output variable for the colors array. | _colors |
See CHANGELOG.
hiulit
Feel free to:
- Open an issue if you find a bug.
- Create a pull request if you have a new cool feature to add to the project.
- Start a new discussion about a feature request.
If you love this project or find it helpful, please consider supporting it through any size donations to help make it better β€οΈ.
If you can't, consider sharing it with the world...
... or giving it a star βοΈ.
Thank you very much!
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.
- Source code: MIT License.