<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>frames</key>
<dict>
<key>${图片名}</key>
<dict>
<key>frame</key>
<string>{{${frameX},${frameY}},{${frameW},${frameH}}</string>
<key>offset</key>
<string>{${offsetX},${offsetY}}</string>
<key>rotated</key>
<${isRotated}/>
<key>sourceColorRect</key>
<string>{{${sourceColorRectX},${sourceColorRectY}},{${sourceColorRectW},${sourceColorRectH}}</string>
<key>sourceSize</key>
<string>{${sourceSizeW},${sourceSizeH}}</string>
</dict>
</dict>
<key>metadata</key>
<dict>
<key>format</key>
<integer>2</integer>
<key>realTextureFileName</key>
<string>${文件名.png}</string>
<key>size</key>
<string>{${总w},${总h}}</string>
<key>smartupdate</key>
<string>${SmartUpdate}</string>
<key>textureFileName</key>
<string>${文件名.png}</string>
</dict>
</dict>
</plist>
>以左上角为[0,0]位置(x轴向右为正,y轴向下为正)
frameX:在图集中的位置x(图片的左上角),
frameY:在图集中的位置y(图片的左上角),
frameW:在图集中的图片大小宽,
frameH:在图集中的图片大小高;
offset:在合成大图的过程中texturePackage会把原图透明的部分删除,offset是这张新的图片的中心点相对于原图的中心点(以sourceSize这个方形的中心点)的偏移,这个是以cocos2d的坐标系为准的,y轴向上为正,x轴向右为正
rotated:图片是否旋转
sourceColorRectX:删除透明部分之后,新位置中心点相对原来中心点的w
sourceCoslorRectY:删除透明部分之后,新位置中心点相对原来中心点的h
sourceColorRectW:删除透明部分之后,图片的宽(通常跟图集里面图片的大小一致)
sourceColorRectH:删除透明部分之后,图片的高(通常跟图集里面图片的大小一致)
sourceSizeW:图片实际的宽(透明部分没有删除)
sourceSizeH:图片实际的高(透明部分没有删除)
通常关系如下:
sourceSizeW/2=sourceColorRectW/2+sourceColorRectX+offsetX;
sourceSizeH/2=sourceColorRectH/2+sourceColorRectY-offsetY;