Single-Frame Image Taml-Generator Tool
by practicing01 · in Torque 2D Beginner · 07/16/2014 (8:52 am) · 1 replies
Sometimes you have a lot of images and need their tamls. Here is a tool I scrambled together in a couple of hours: www.dropbox.com/s/foiaajftgfy5tm4/PNG_Tool.tar.gz
It uses a library called LodePNG to get the image dimensions and prints something along these lines:
main.c: pastebin.com/V9kerHqL
You'll have to batch rename the .txt extensions to .asset.taml. You can use KRename for that.
It's a shame that you can't parse files by bytes with TS. Apologies for my horrible C, this was done hastily :P.
Edit:
Hastily thrown together addition: main.c pastebin.com/EEpA91Um
This will add cellcount/dimensions based on the filename. It requires the following format: Your_Image_Name-CellWidthxCellHeight.png ( '-' and 'x' required, CellWidth and CellHeight are integers).
It uses a library called LodePNG to get the image dimensions and prints something along these lines:
<ImageAsset AssetName="Image_Floor_Tile" ImageFile="Floor_Tile.png" CellCountX="1" CellCountY="1" CellWidth="16" CellHeight="16" />
main.c: pastebin.com/V9kerHqL
You'll have to batch rename the .txt extensions to .asset.taml. You can use KRename for that.
It's a shame that you can't parse files by bytes with TS. Apologies for my horrible C, this was done hastily :P.
Edit:
Hastily thrown together addition: main.c pastebin.com/EEpA91Um
This will add cellcount/dimensions based on the filename. It requires the following format: Your_Image_Name-CellWidthxCellHeight.png ( '-' and 'x' required, CellWidth and CellHeight are integers).
Torque Owner Richard Ranft
Roostertail Games
For multi-celled images you'd need some more code....