This is a little standalone tool that allows you to make png animation stripes from gif animations. The good thing here is that you can have gifs with all animations you want to have in one file and then export them to pngs and anim timing files including proper naming in one go.
Please note, that this should only be used for objects with alot of animations. If you have a single animation stripe, just export it directly to a png and make the anim file by hand. (see below)
How to use it
- Setup the settings.txt as described below.
- Run the application. This will open the "Open dialogue" from your OS
- Navigate to the folder where your gifs are. (Be sure that they are all in the same dimension or the tool will crash)
- All the png and .anim files are now generated and should be in the folder with your gifs.
- Copy them over in the folders were they belong.
Note: You need to run the atlas builder before you can use the new assets.
The settings.txt needs to be placed in the main folder besides the executable of this tool.
Tip: I always have multiple copies of this file at hand so I just can copy over the settings.
How it looks
// Image size to extract 32,32 // Appended output names #Down #DownRight #Right #UpRight #Up
What is what setting
Image size: This describes the dimension of 1 frame of the resulting png and not the dimension of the gif or the whole png stripe. (usually it is 32*32)
Appended Output names: Use this to make the resulting animation stripes to have the correct name endings. Please note the program will crash if the amount of names in relativity to the dimension of the gif is not correct. (In the sample below we have 5 animations a 32*32 so we need the five names extensions)
And here is a fitting gif file so you can see how it looks like:
Note: The file name should be ginaNia#Run.gif, but this wiki does not like '#' in names ;)
If you run the tool with this settings you will get 5 png and 5 .anim files named like this:
ginaNia#Run#Down.png and .anim
ginaNia#Run#DownRight.png and .anim
Note about the gif: Please switch of any size optimization for gifs when exporting them. This will lead into only partially drawn frames.
The anim file defines the timing of each frame in an animation. (The values are milliseconds) If you do not provide an anim file with the animation the game just will use a default and it may look different then you want it to be.
Note: The anim files always gets generated with this tool. But sometimes you want to edit by hand or make it manually.
Note 2: The name of the anim file needs to be the exact same as the one of the png file. (including upper/lower cases)
How the anim file looks
# Loop animation, frame times ... true,100,100,100,100,100,100
- First value: Loop: true/false set it to false if the animation only should be played once per event.
- Timings: Per frame timings in milliseconds. (Important: The ammount of timings need to be the same as the frame count)
- If the gif animation only has on frame, then the anim file timing will be set to 0. That will make the game crash. So please edit the anim file manually in this case. (A good default timing is around 40-100 ms.)