# egret atlas to plist --- [plist格式介紹](https://www.codeandweb.com/blog/2016/01/29/cocos2d-plist-format-explained) --- ### json格式比較 :::info egret atlas json ``` {"file":"123.png", "frames":{ "a_png":{ "x":10, "y":20, "w":95, "h":92, "offX":0, "offY":0, "sourceW":95, "sourceH":92 } } } ``` ::: :::info 可轉成 plist 的 json ``` {"frames":{ "a_png.png":{ "aliases":[], "spriteOffset":"{0,0}", "spriteSize":"{95,92}", "spriteSourceSize":"{95,92}", "textureRect":"{{10,20},95,92}}", "textureRotated":false } }, "metadata":{ "format":3, "realTextureFileName":"123.png", "textureFileName":"123.png", "size":"{200,200}" } } ``` ::: :::warning 1. 需要額外填入 atlas 的尺寸 2. frames 欄位底下的圖片名稱, 需要額外加上附檔名, 否則無論 frames 有多少張圖, 在 cocos creator 只能讀到最後一張圖 ::: --- ## 目前的還原步驟 * 重新組合 json 補齊 plist 所需資訊 :::success 1. 複製 egret atlas json 內容 2. 使用內部工具 http://dev3-build01/tool_web/egret2plist/ 3. 貼到 from 欄位 4. 填寫 atlas 尺寸到 width 和 height 5. 按下 convert 並且複製 to 欄位的內容 ::: * 使用第三方工具還原成 plist :::success 1. http://json2plist.sinaapp.com 2. 選擇 JSON -> plist ::: * 第三方的 plist 排版工具 (方便閱讀) :::success https://codebeautify.org/xmlvalidator/cb598cce ::: --- ## 待完成的功能 * 直接還原成 plist * plist 排版功能 --- ###### tags: `Creator3D`