TexturePacker 命令行打包图片shell脚本

#!/bin/bash

#工程路径


CURRENT_PATH=$(cd `dirname $0`; pwd)
cd $CURRENT_PATH
cd .. 


#代码位置
TMP=$(pwd)
TEXTURES_PACKAGE_NAME=AllSprite
IMAGE_PATH=$TMP/img/1136x640
TEXTURES_PACKAGE_DIR=$TMP/res/textures/1136x640


cd $TEXTURES_PACKAGE_DIR
rm -rf *.plist
rm -rf *.pvr.ccz

echo $TEXTURES_PACKAGE_DIR
echo packeage image ...


TP=TexturePacker

#===================================================
#Config
#===================================================
#Output
FORMAT=cocos2d		
DATD=$TEXTURES_PACKAGE_NAME{n1}.plist	
TEXTURE_FORMAT=pvr2ccz
SHEET=$TEXTURES_PACKAGE_NAME{n1}.pvr.ccz
OPT=RGBA4444
PREMULTIPLY_ALPHA=--premultiply-alpha
DITHERING=--dither-none-nn

#Geometry
SIZE_CONSTRAINTS=POT
SCALE=1
SCALE_MODE=Smooth

#Layout
ALGORITHM=MaxRects
HEURISTICS=Best
PACK=Best
MULTIPACK=--multipack
BORDER_PADDING=2
SHAPE_PADDING=2
INNER_PADDING=0
EXTRUDE=0
COMMON_DIVISOR_X=1
COMMON_DIVISOR_Y=1
REDUCE_BORDER_ARTIFACTS=""
ENABLE_ROTATION=--enable-rotation
TRIM_MODE=Trim
TRIM_THRESHOLD=1




#===================================================
#Command
#===================================================

$TP --format $FORMAT \
				--data $TEXTURES_PACKAGE_DIR/$DATD \
				--texture-format $TEXTURE_FORMAT \
				--sheet $TEXTURES_PACKAGE_DIR/$SHEET \
				--opt $OPT \
				$PREMULTIPLY_ALPHA \
				$DITHERING \
				--size-constraints $SIZE_CONSTRAINTS \
				--scale $SCALE \
				--scale-mode $SCALE_MODE \
				--algorithm $ALGORITHM \
				--maxrects-heuristics $HEURISTICS \
				--pack-mode $PACK \
				$MULTIPACK \
				$ENABLE_ROTATION \
				--trim-mode $TRIM_MODE \
				--trim-threshold $TRIM_THRESHOLD $IMAGE_PATH




TexturePacker 命令行打包图片shell脚本

展开阅读全文

没有更多推荐了,返回首页