使用texturePaker批量转化pvr为pn

1、安装texturePacker和相关命令行工具;这里主要使用的时命令行工具;

2、在终端写下改命令行:

for f in $(find . -name "*.png"); do tf=$(echo $f | sed 's/.png//'); echo $tf ; /usr/local/bin/TexturePacker $f --smart-update  --texture-format pvr2ccz --format cocos2d --sheet $tf.pvr.ccz --maxrects-heuristics best  --enable-rotation --shape-padding 0 --max-size 2048 --opt RGBA8888 --trim --size-constraints AnySize; rm $f ; done

解释一下:

1、将所要转换的图片所在的文件夹放到一个任何一个目录下,在该目录下执行上述脚本:

2、for f in $(find . -name "*.png");#找到所有以png结尾的图片;

do tf=$(echo $f|sed `s/.png//`); #得到图片的储存路径

以下是texturePaker相关:

/usr/local/bin/TexturePacker $f --smart-update  --texture-format pvr2ccz --format cocos2d --sheet $tf.pvr.ccz --maxrects-heuristics best  --enable-rotation --shape-padding 0 --max-size 2048 --opt RGBA8888 --trim --size-constraints AnySize; 

/usr/local/bin/TexturePacker:#texturePakcer的存储路径;

$f --smart-update  --texture-format pvr2ccz --format cocos2d --sheet $tf.pvr.ccz --maxrects-heuristics best  --enable-rotation --shape-padding 0 --max-size 2048 --opt RGBA8888 --trim --size-constraints AnySize;  #texturePacker相关参数,可以使用texturePakcer --help在终端查看;

rm $f  #删除原来的png图片

原创文章,转载请注明出处,谢谢:有什么问题,欢迎讨论)参数和gui相关可以参考这篇博文: http://www.cnblogs.com/flyFreeZn/p/3587770.html

posted on 2015-01-23 14:43  sousou123  阅读(387)  评论(0编辑  收藏  举报

导航