free-tex-packer-core
free-tex-packer-core copied to clipboard
Add Cocos3d exporter with plist format3
Cocos Creator (AFIK 3.3.0 and 2.4.8) rotates the image by 90deg clockwise with Sharp when generating an atlas:
Please consider rotating 90deg clockwise when exporting toCocos2d with plist format3.
Here is a proposal of Cocos2d.mst:
{{=<% %>=}}
<?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>
<%#rects%>
<key><%&name%></key>
<dict>
<key>aliases</key>
<array/>
<key>spriteOffset</key>
<string>{<% spriteSourceSize.x | offsetLeft : spriteSourceSize.w : sourceSize.w %>,<% spriteSourceSize.y | offsetRight : spriteSourceSize.h : sourceSize.h %>}</string>
<key>spriteSize</key>
<string>{<%spriteSourceSize.w%>,<%spriteSourceSize.h%>}</string>
<key>spriteSourceSize</key>
<string>{<%sourceSize.w%>,<%sourceSize.h%>}</string>
<key>textureRect</key>
<string>{{<%frame.x%>,<%frame.y%>},{<%frame.w%>,<%frame.h%>}}</string>
<key>textureRotated</key>
<<%rotated%>/>
</dict>
<%/rects%>
</dict>
<key>metadata</key>
<dict>
<key>format</key>
<integer>3</integer>
<key>pixelFormat</key>
<string><%config.format%></string>
<key>premultiplyAlpha</key>
<false/>
<key>realTextureFileName</key>
<string><%config.imageFile%></string>
<key>size</key>
<string>{<%config.imageWidth%>,<%config.imageHeight%>}</string>
<key>textureFileName</key>
<string><%config.imageName%></string>
</dict>
</dict>
</plist>
<%={{ }}=%>
summary
- Change rotate(90) to rotate(-90) when export for Cocos
- Maybe add an option
rotationDirectioninto config rotation cw/ccw like CustomExporter - Update Cocos2d exporter from plist format2 to format
update: Here is a PR also fix the rotation issue: